//生成入库订单 protected void btnCreate_Click(object sender, EventArgs e) { //1.获取数据发送到DAL //2.p判断返回值,是否新增成功 //3.把按钮隐藏 this.btnCreate.Visible = false; //4.显示panel //this.Panel1.Visible = true; SaveIntoMessage s = new SaveIntoMessage(); s.AppendID = this.txtOrderID.Text; s.CreateDate = this.txtMakeDate.Text; s.AppendType = int.Parse(this.DDLIntoType.SelectedValue); s.StoreHouseID = int.Parse(this.txtHouse.Text); s.HouseDetailID = int.Parse(this.txtArea.Text); s.UserName = Session["UserName"].ToString(); //当前登录人的名字 s.TradeDate = this.DateTime1.Value; //选择日期 s.AlreadyPay = Convert.ToDouble(this.txtPay.Text); s.Description = this.txtDec.Text; bool b = BLL.PIntoBLL.ProIntoManager.SaveAllInto(s); if (b) { //显示下面的表格 } }
//点击生成入库订单 添加主要信息到数据库 public static bool SaveAllInto(SaveIntoMessage s) { Database db = DatabaseFactory.CreateDatabase("Constr"); string sql = string.Format(@"insert into t_AppendStock (AppendID,CreateDate,AppendType,StoreHouseID,HouseDetailID,TradeDate,TotalPrice,AlreadyPay,Description,AuditingUser,UserName) values ('{0}','{1}',{2},{3},{4},'{5}',{6},{7},'{8}','{9}','{10}')", s.AppendID, s.CreateDate, s.AppendType, s.StoreHouseID, s.HouseDetailID, s.TradeDate, s.TotalPrice, s.AlreadyPay, s.Description, s.AuditingUser, s.UserName); return(db.ExecuteNonQuery(CommandType.Text, sql) > 0); }
//查询 显示信息到入库明细单 public static SaveIntoMessage GetDetails(string AppendID) { Database db = DatabaseFactory.CreateDatabase("Constr"); string sql = string.Format(@"select t_AppendStock.AppendID,t_AppendStock.CreateDate,t_AppendStock.UserName, t_AppendStock.HouseDetailID,t_AppendStock.StoreHouseID,t_AppendStock.TradeDate, t_AppendStock.TotalPrice,t_AppendStock.State,t_AppendStock.Description from t_AppendStock where t_AppendStock.AppendID='{0}'", AppendID); DataSet ds = db.ExecuteDataSet(CommandType.Text, sql); SaveIntoMessage s = new SaveIntoMessage(); s.AppendID = ds.Tables[0].Rows[0]["AppendID"].ToString(); s.CreateDate = ds.Tables[0].Rows[0]["CreateDate"].ToString(); s.UserName = ds.Tables[0].Rows[0]["UserName"].ToString(); s.HouseDetailID = int.Parse(ds.Tables[0].Rows[0]["HouseDetailID"].ToString()); s.StoreHouseID = int.Parse(ds.Tables[0].Rows[0]["StoreHouseID"].ToString()); s.HouseStore = GetHouseStore(s.HouseDetailID, s.StoreHouseID); s.TotalPrice = Convert.ToDouble(ds.Tables[0].Rows[0]["TotalPrice"].ToString()); s.State = int.Parse(ds.Tables[0].Rows[0]["State"].ToString()); s.TradeDate = ds.Tables[0].Rows[0]["TradeDate"].ToString(); return(s); }
public void ShowDetailInfo(string appendID) { SaveIntoMessage s = BLL.PIntoBLL.ProIntoManager.GetDetails(appendID); this.txtID.Text = s.AppendID; this.txtCreateDate.Text = s.TradeDate; this.txtPeople.Text = s.UserName; this.txtHouse.Text = s.HouseStore.ToString(); this.txtTotal.Text = s.TotalPrice.ToString(); if (s.State == 1) { this.txtState.Text = "未审核"; this.txtState.ForeColor = System.Drawing.Color.Red; } else { this.txtState.Text = "已审核"; this.txtState.ForeColor = System.Drawing.Color.Green; } this.txtTradeDate.Text = s.TradeDate; this.txtDesc.Text = s.Description; }
//保存信息到数据库的订单明细 public static bool SaveAllInto(SaveIntoMessage s) { return(DAL.PIntoDAL.ProIntoService.SaveAllInto(s)); }