本帖最后由 茹化肖 于 2013-9-25 09:51 编辑
别的先不说,先上代码大家帮着看下- using System;
- using System.Collections.Generic;
- using System.Text;
- using LogisManageLibrary;
- using System.Data;
- using SW.Henu.DAO;
- namespace LogisManageLibrary.BaseInfManage
- {
- public class TCarInf:AManage
- {
- /// <summary>
- /// 车辆信息表字段
- /// </summary>
- private string carId{get;set;}//车辆ID
- private string websiteId{get;set;}//网点ID
- private string carType{get;set;}//车辆类型
- private string carCardNum{get;set;}//车牌号
- private string carDriver{get;set;}//司机
- private string carDriverTel{get;set;}//司机电话
- private string carDriverMoble{get;set;}//司机手机号
- private string carDriverId{get;set;}//司机身份证号
- private string carDriverAddr { get; set; }//司机地址
- private string carLoad { get; set; }//车辆载重
- private string carVolume { get; set; }//车辆容积
- private string carTransPrice { get; set; }//运价费
- private string carState { get; set; }//车辆状态
- /// <summary>
- /// 添加对应字段到泛型
- /// </summary>
- public TCarInf()
- {
- Initialize();
- attributeList.Add(carId);
- attributeList.Add(websiteId);
- attributeList.Add(carType);
- attributeList.Add(carCardNum);
- attributeList.Add(carDriver);
- attributeList.Add(carDriverTel);
- attributeList.Add(carDriverMoble);
- attributeList.Add(carDriverId);
- attributeList.Add(carDriverAddr);
- attributeList.Add(carLoad);
- attributeList.Add(carVolume);
- attributeList.Add(carTransPrice);
- attributeList.Add(carState);
- }
- /// <summary>
- /// 设置需要操作的表名
- /// </summary>
- public override void Initialize()
- {
- tableName = "dbo.TCarInf";
- }
- public override StringBuilder SetSelectSQL()
- {
- return new StringBuilder("select " + attributeList[0] + " as 车辆编号," + attributeList[1] + " as 所属网点," + attributeList[2] + " as 车辆类型,"
- + attributeList[3] + " as 车牌号," + attributeList[4] + " as 司机," + attributeList[5] + " as 司机电话," + attributeList[6] + " as 司机手机,"
- + attributeList[7] + " as 司机身份证," + attributeList[8] + " as 司机地址," + attributeList[9] + " as 吨位," + attributeList[10] + " as 容积,"
- + attributeList[11] + " as 运费," + attributeList[12] + " as 状态," + " from " + tableName);
- }
- public override StringBuilder SetInsertSQL()
- {
- throw new NotImplementedException();
- }
- public override StringBuilder SetUpdateSQL()
- {
- throw new NotImplementedException();
- }
- public override StringBuilder SetDeleteSQL()
- {
- throw new NotImplementedException();
- }
- }
- }
复制代码 这是我定义的类。下面是我想实例化的时候 但是不能被找到。- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using LogisManageLibrary.BaseInfManage;
- namespace LogisManage.BaseInfManage
- {
- /// <summary>
- /// 车辆管理
- /// </summary>
- public partial class frmCar : frmBase
- {
- public static frmCar currentInstance = null;
- /// <summary>
- /// 重写父类的show,确保只显示一个实例
- /// </summary>
- /// <param name="owner"></param>
- public new void Show(System.Windows.Forms.IWin32Window owner)
- {
- if (currentInstance == null)
- {
- base.Show(owner);
- currentInstance = this;
- }
- else
- {
- currentInstance.Activate();
- }
- return;
- }
- private void frmCar_FormClosed(object sender, FormClosedEventArgs e)
- {
- currentInstance = null;
- }
- //这里找不到写过的类 ?为啥?
- LogisManageLibrary.BaseInfManage.
-
复制代码 大家看看这些 应该能明白我说的啥意思的吧?求助、、、 |