//提交 保存信息到库存盘点表 public static bool AddStock(StockInto st) { Database db = DatabaseFactory.CreateDatabase("Constr"); string sql = string.Format(@"insert into t_Inventory(InventoryID,CreateDate,StoreHouseID,HouseDetailID,ProductsID,RealityNum,BillNum,AdjustNum,UserName,Description) values('{0}','{1}',{2},{3},{4},{5},{6},{7},'{8}','{9}')", st.InventoryID, st.CreatDate, st.StoreHouseID, st.HouseDetailID, st.ProductsID, st.BillNum, st.RealityNum, st.AdjustNum, st.UserName, st.Description == "" ? " " : st.Description); return(db.ExecuteNonQuery(CommandType.Text, sql) > 0); }
protected void btnSubmit_Click(object sender, EventArgs e) { StockInto s = new StockInto(); s.InventoryID = this.txtID.Text; s.CreatDate = this.txtCreateDate.Text; s.StoreHouseID = int.Parse(this.txtHouse.Text); s.HouseDetailID = int.Parse(this.txtArea.Text); s.ProductsID = int.Parse(this.ProID.Text); s.BillNum = int.Parse(this.txtBill.Text); s.RealityNum = int.Parse(this.txtReal.Text); s.AdjustNum = int.Parse(this.txtAdjust.Text); s.UserName = this.txtPeople.Text; s.TradeDate = this.DateTime2.Value;//选择日期 s.Description = this.txtDesc.Text; bool b = BLL.InventoryBLL.InventoryManager.AddStock(s); if (b) { Response.Write("<script>alert('提交成功')</script>"); } }
public static bool AddStock(StockInto st) { return(DAL.InventoryDAL.InventoryService.AddStock(st)); }