private string EnterStockDefToExcel(string BeginDate, string EndDate) { DataSet ds = new ZhangWei.BLL.EnterStock().EnterStockDefinite(BeginDate, EndDate); string ToExcel = new LTP.Common.DataToExcel().OutputExcel(ds.Tables[0], "入库明细 " + BeginDate + "—" + EndDate, HttpContext.Current.Server.MapPath("/ExcelFiles/"), "入库明细"); return(ToExcel); }
private void ShowInfo(int EnterStock_ID) { ZhangWei.BLL.EnterStock bll = new ZhangWei.BLL.EnterStock(); ZhangWei.Model.EnterStock model = bll.GetModel(EnterStock_ID); this.lblEnterStock_ID.Text = model.EnterStock_ID.ToString(); this.lblEnterDate.Text = model.EnterDate.ToString(); this.lblDept_ID.Text = model.Dept_ID.ToString(); this.lblStoreHouse_ID.Text = model.StoreHouse_ID.ToString(); this.lblEmployee_ID.Text = model.Employee_ID.ToString(); }
private string EnterStockGatToExcel(string BeginDate, string EndDate, string according) { if (according == "1") { DataSet ds = new ZhangWei.BLL.EnterStock().EnterStockGather(BeginDate, EndDate); string ToExcel = new LTP.Common.DataToExcel().OutputExcel(ds.Tables[0], "入库汇总(按品种) " + BeginDate + "—" + EndDate, HttpContext.Current.Server.MapPath("/ExcelFiles/"), "入库汇总(按品种)"); return(ToExcel); } else { DataSet ds = new ZhangWei.BLL.EnterStock().GetGatherByList(BeginDate, EndDate); string ToExcel = new LTP.Common.DataToExcel().OutputExcel(ds.Tables[0], "入库汇总(按单号) " + BeginDate + "—" + EndDate, HttpContext.Current.Server.MapPath("/ExcelFiles/"), "入库汇总(按单号)"); return(ToExcel); } }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsDateTime(txtEnterDate.Text)) { strErr += "EnterDate格式错误!\\n"; } if (!PageValidate.IsNumber(txtDept_ID.Text)) { strErr += "Dept_ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtStoreHouse_ID.Text)) { strErr += "StoreHouse_ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtEmployee_ID.Text)) { strErr += "Employee_ID格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int EnterStock_ID = int.Parse(this.lblEnterStock_ID.Text); DateTime EnterDate = DateTime.Parse(this.txtEnterDate.Text); int Dept_ID = int.Parse(this.txtDept_ID.Text); int StoreHouse_ID = int.Parse(this.txtStoreHouse_ID.Text); int Employee_ID = int.Parse(this.txtEmployee_ID.Text); ZhangWei.Model.EnterStock model = new ZhangWei.Model.EnterStock(); model.EnterStock_ID = EnterStock_ID; model.EnterDate = EnterDate; model.Dept_ID = Dept_ID; model.StoreHouse_ID = StoreHouse_ID; model.Employee_ID = Employee_ID; ZhangWei.BLL.EnterStock bll = new ZhangWei.BLL.EnterStock(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }