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="gtm"></param> public void Update(GoodsTypeMOD gtm) { sql = "UPDATE GoodsType SET goods_type=@goods_type where id=@id"; SqlParameter[] sp = { new SqlParameter("@goods_type", gtm.Goods_type), new SqlParameter("@id", gtm.Id) }; DBHelper.ExecuteNonQuery(sql, sp); }
/// <summary> /// 获取父节点 /// </summary> /// <returns></returns> //public int GetParent(int id) //{ // sql = ""; //} /// <summary> /// 插入 /// </summary> public void Insert(GoodsTypeMOD gtm) { sql = "insert into GoodsType values(@goods_type,@node_parent,@node_depth)"; SqlParameter[] sp = { new SqlParameter("@goods_type", gtm.Goods_type), new SqlParameter("@node_parent", gtm.Node_parent), new SqlParameter("@node_depth", gtm.Node_depth) }; DBHelper.ExecuteNonQuery(sql, sp); }
private List <GoodsTypeMOD> GetList(string sql, params SqlParameter[] sp) //Dataset赋值给实体类集合 { ds = DBHelper.GetDataset(sql, sp); list.Clear(); foreach (DataRow rows in ds.Tables[0].Rows) { GoodsTypeMOD gtm = new GoodsTypeMOD(); gtm.Id = Int32.Parse(rows[0].ToString()); gtm.Goods_type = rows[1].ToString(); gtm.Node_parent = Int32.Parse(rows[2].ToString()); gtm.Node_depth = Int32.Parse(rows[3].ToString()); list.Add(gtm); } return(list); }
private void SetGoodsinfo() //自动填入物品信息输入框的值 { if (comb_goods_name.Text != "" && isgive) { listgm = gb.ById(Int32.Parse(comb_goods_name.SelectedValue.ToString())); if (listgm.Count > 0) { gm = listgm[0]; gtm = gtb.FindID(gm.Goods_type_id); if (tree_label.Text == "双击打开下一层") { tree_label.Text = gtm.Goods_type; goods_type_id = gtm.Id; } text_goods_code.Text = gm.Goods_code; text_specifications.Text = gm.Specifications; text_goods_volume.Text = gm.Goods_volume; text_goods_wight.Text = gm.Goods_wight; text_goods_note.Text = gm.Goods_note; isgive = false; } } }
/// <summary> /// 插入 /// </summary> /// <param name="gtm"></param> public void Insert(GoodsTypeMOD gtm) { gtd.Insert(gtm); }
/// <summary> /// 修改 /// </summary> /// <param name="gtm"></param> public void Update(GoodsTypeMOD gtm) { gtd.Update(gtm); }