示例#1
0
文件: type_add.cs 项目: hkiaipc/jsb
 public type_add()
 {
     InitializeComponent();
     define_type = new data_define.type();
     oper_type = new operation.o_type();
 }
示例#2
0
文件: type.cs 项目: hkiaipc/jsb
 public List<data_define.type> type_listdt(data_define.type model)
 {
     string str1 = "";
     List<data_define.type> _listtype = new List<data_define.type>();
     if (model.type_id > 0)
     { str1 = "where t_type.type_id=" + model.type_id + ""; }
     else if (model.type_name.Length > 0)
     {
         if (str1.Length > 0)
         {
             str1 = str1 + " and t_type.type_name='" + model.type_name + "'";
         }
         else
         {
             str1 = "where t_type.type_name=" + model.type_name + "";
         }
     }
     string sql = string.Format("select * from t_type " + str1);
     DataTable ddt=sqlconn.DBIBase.Instance.ExecuteDataTable(sql);
     if(ddt.Rows.Count>0)
     {
         for(int i=0;i<ddt.Rows.Count;i++)
         {
             data_define.type _model = new data_define.type();
             _model.type_id=int.Parse(ddt.Rows[i]["type_id"].ToString());
             _model.type_name=ddt.Rows[i]["type_name"].ToString();
             _listtype.Add(_model);
         }
     }
     return _listtype;
 }