private void PutInventoryprint_Load(object sender, EventArgs e)
 {
     bm  = bb.FindById(id)[0];            //清单
     gm  = gb.ById(bm.Goods_id)[0];       //物品
     wnm = wnb.FindById(bm.Client_id)[0]; //仓库
     cm  = cb.FindId(bm.Client_id)[0];    //客户
     gtm = gtb.FindID(gm.Goods_type_id);  //物品类型
     mm  = mb.FindId(bm.Manager_id)[0];   //管理员
     otm = otb.FindById(bm.Operation_type_id)[0];
     goods_name_text.Text       = gm.Goods_name;
     goods_amount_text.Text     = bm.Goods_amount.ToString();
     goods_code_text.Text       = gm.Goods_code;
     goods_note_text.Text       = gm.Goods_note;
     goods_price_text.Text      = bm.Goods_price.ToString();
     goods_type_text.Text       = gtm.Goods_type;
     goods_volume_text.Text     = gm.Goods_volume;
     goods_wight_text.Text      = gm.Goods_wight;
     warehouse_text.Text        = wnm.Warehouse_name;
     client_text.Text           = cm.Client_name;
     specifications_text.Text   = gm.Specifications;
     type_id_text.Text          = otm.Operation_type;
     expiration_date_text.Text  = bm.Expiration_date;
     manufacture_date_text.Text = bm.Manufacture_date;
     lot_number_text.Text       = bm.Lot_number;
     bill_note_text.Text        = bm.Bill_note;
     operation_name_text.Text   = mm.Manager_name;
 }
 /// <summary>
 /// 下拉列表选择事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void com_client_id_SelectionChangeCommitted(object sender, EventArgs e)
 {
     cb = new ClientBLL();
     cm = cb.FindId((int)com_client_id.SelectedValue)[0];
     text_client_name.Text     = cm.Client_name;
     text_client_position.Text = cm.Client_address;
     text_client_contacts.Text = cm.Client_contacts;
     text_client_phone.Text    = cm.Client_phone;
     text_client_note.Text     = cm.Client_note;
 }
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="cm"></param>
 public void Insert(ClientMOD cm)
 {
     sql = "INSERT INTO Client VALUES(@client_name,@client_address,@client_contacts,@client_phone,@client_note)";
     SqlParameter[] sp =
     {
         new SqlParameter("@client_name",     cm.Client_name),
         new SqlParameter("@client_address",  cm.Client_address),
         new SqlParameter("@client_contacts", cm.Client_contacts),
         new SqlParameter("@client_phone",    cm.Client_phone),
         new SqlParameter("@client_note",     cm.Client_note)
     };
     DBHelper.ExecuteNonQuery(sql, sp);
 }
 /// <summary>
 /// 更改
 /// </summary>
 /// <param name="cm"></param>
 public void Update(ClientMOD cm)
 {
     sql = "UPDATE Client SET client_name=@client_name,client_address=@client_address,client_contacts=@client_contacts,client_phone=@client_phone,client_note=@client_note where id=@id";
     SqlParameter[] sp =
     {
         new SqlParameter("@id",              cm.Id),
         new SqlParameter("@client_name",     cm.Client_name),
         new SqlParameter("@client_address",  cm.Client_address),
         new SqlParameter("@client_contacts", cm.Client_contacts),
         new SqlParameter("@client_phone",    cm.Client_phone),
         new SqlParameter("@client_note",     cm.Client_note)
     };
     DBHelper.ExecuteNonQuery(sql, sp);
 }
 private List <ClientMOD> GetList(string sql, params SqlParameter[] sp)    //Dataset赋值给实体类集合
 {
     ds = DBHelper.GetDataset(sql, sp);
     list.Clear();
     foreach (DataRow rows in ds.Tables[0].Rows)
     {
         ClientMOD cm = new ClientMOD();
         cm.Id              = Int32.Parse(rows[0].ToString());
         cm.Client_name     = rows[1].ToString();
         cm.Client_address  = rows[2].ToString();
         cm.Client_contacts = rows[3].ToString();
         cm.Client_phone    = rows[4].ToString();
         cm.Client_note     = rows[5].ToString();
         list.Add(cm);
     }
     return(list);
 }
Пример #6
0
 /// <summary>
 /// 插入
 /// </summary>
 /// <param name="cm"></param>
 public void Insert(ClientMOD cm)
 {
     cd.Insert(cm);
 }
Пример #7
0
 /// <summary>
 /// 更改
 /// </summary>
 /// <param name="cm"></param>
 public void Update(ClientMOD cm)
 {
     cd.Update(cm);
 }