/// <summary> /// 绑定仓库信息 /// </summary> private void DataBindWareHouse() { //通过管理员编号获取仓库相应的权限 DataTable permissionDT = StorageInBLL.GetMoreManagerPermissionByNumber(Convert.ToString(Session["Company"])); if (permissionDT.Rows.Count < 1) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001963", "对不起,你没有仓库权限!"))); return; } else { ddlWareHouse.Items.Clear(); DataTable wareHouseDT = StorageInBLL.GetWareHouseInfoByNumberCountryCode(Convert.ToString(Session["Company"]), ddlCountry.SelectedValue); if (wareHouseDT.Rows.Count < 1) { ddlDepotSeat.Items.Clear(); return; } else { ddlWareHouse.DataSource = wareHouseDT; ddlWareHouse.DataTextField = "WareHouseName"; ddlWareHouse.DataValueField = "WareHouseID"; ddlWareHouse.DataBind(); DataBindDepotSeat(); } } }
private void BindInfo(string billid) { InventoryDocModel idm = StorageInBLL.getOrderInfo(billid); this.txtAddress.Text = idm.Address.ToString(); this.txtpici.Text = idm.BatchCode.ToString(); this.txtOperationPerson.Text = idm.OperationPerson.ToString(); this.txtOriginalDocID.Text = idm.OriginalDocID.ToString(); this.txtMemo.Text = idm.Note.ToString(); this.ddlWareHouse.SelectedValue = idm.WareHouseID.ToString(); int wareHouseID = Convert.ToInt32(idm.WareHouseID.ToString()); this.ddlDepotSeat.SelectedValue = idm.DepotSeatID.ToString(); this.ddlProvider.SelectedValue = Convert.ToString(idm.Provider); //ddlCountry.SelectedValue = CountryBLL.GetCountryCodeByID(idm.Currency.ToString()); this.ViewState["billId"] = billid; DataTable dt = StorageInBLL.getProduct(billid); foreach (DataRow dr in dt.Rows) { InventoryDocDetailsModel model = new InventoryDocDetailsModel(); model.ProductID = int.Parse(dr["productid"].ToString()); model.UnitPrice = double.Parse(dr["unitprice"].ToString()); model.MeasureUnit = "0"; //model.Pici = dr["pici"].ToString(); model.ProductQuantity = double.Parse(dr["productquantity"].ToString()); list.Add(model); } Session["storageList"] = list; }
private void bindProvider() { ddlProvider.DataSource = StorageInBLL.GetProviderInfo(); ddlProvider.DataTextField = "Name"; ddlProvider.DataValueField = "ID"; ddlProvider.DataBind(); ddlProvider_SelectedIndexChanged(null, null); }
/// <summary> /// 绑定库位信息 /// </summary> private void DataBindDepotSeat() { int wareHouseID = Convert.ToInt32(ddlWareHouse.SelectedItem.Value); ddlDepotSeat.DataSource = StorageInBLL.GetDepotSeatInfoByWareHouaseID(wareHouseID); ddlDepotSeat.DataTextField = "SeatName"; ddlDepotSeat.DataValueField = "DepotSeatID"; ddlDepotSeat.DataBind(); }
private void BindDropDownList() { /* Name,Number,ID */ ddlProvider.DataTextField = "Name"; ddlProvider.DataValueField = "ID"; ddlProvider.DataSource = StorageInBLL.GetProviderInfo(); ddlProvider.DataBind(); ViewState["isDataBind"] = "Y"; }
/// <summary> /// 绑定仓库信息 /// </summary> private void DataBindWareHouse() { ///通过管理员编号获取仓库相应的权限 DataTable dt = StorageInBLL.GetMoreManagerPermissionByNumber(Session["Company"].ToString()); ddlWareHouse.DataTextField = "WareHouseName"; ddlWareHouse.DataValueField = "WareHouseID"; ddlWareHouse.DataSource = dt; ddlWareHouse.DataBind(); }
private void BindDropDownList() { ///通过管理员编号获取仓库相应的权限 DataTable dt = StorageInBLL.GetMoreManagerPermissionByNumber(Session["Company"].ToString()); ddlWareHouse.DataTextField = "WareHouseName"; ddlWareHouse.DataValueField = "WareHouseID"; ddlWareHouse.DataSource = dt; ddlWareHouse.DataBind(); ViewState["isDataBind"] = "Y"; }
private void DataBindWareHouse() { ///通过管理员编号获取仓库相应的权限 DataTable dt = StorageInBLL.GetMoreManagerPermissionByNumber(Session["Company"].ToString()); DataView dataev = new DataView(dt); dataev.RowFilter = "[CountryCode]=" + DropDownList1.SelectedValue; ddlWareHouse.DataSource = dataev; ddlWareHouse.DataTextField = "WareHouseName"; ddlWareHouse.DataValueField = "WareHouseID"; //ddlWareHouse.DataSource = dt; ddlWareHouse.DataBind(); }
public static bool WPermission(string company) { DataTable dt = StorageInBLL.GetMoreManagerPermissionByNumber(company); if (dt == null || dt.Rows.Count <= 0) { return(false); } else { return(true); } }
/// <summary> /// 绑定库位信息 /// </summary> private void DataBindDepotSeat() { if (!string.IsNullOrEmpty(ddlWareHouse.SelectedValue) && ddlWareHouse.SelectedValue != "-2") { int wareHouseID = Convert.ToInt32(ddlWareHouse.SelectedItem.Value); ddlDepotSeat.DataSource = StorageInBLL.GetDepotSeatInfoByWareHouaseID(wareHouseID); ddlDepotSeat.DataTextField = "SeatName"; ddlDepotSeat.DataValueField = "DepotSeatID"; ddlDepotSeat.DataBind(); } else { ddlDepotSeat.Items.Clear(); ddlDepotSeat.Items.Add(new ListItem(GetTran("000589", "无库位"), "-2")); } }
/// <summary> /// 绑定库位信息 /// </summary> private void DataBindDepotSeatInfo() { ///获取库位信息 DataTable dtDepotSeat = StorageInBLL.GetDepotSeatInfoByWareHouaseID(int.Parse(ViewState["WareHouseID"].ToString())); ViewState["sortDepotSeat"] = dtDepotSeat; DataView dv = new DataView((DataTable)ViewState["sortDepotSeat"]); if (ViewState["sortDepotSeatstring"] == null) { ViewState["sortDepotSeatstring"] = dtDepotSeat.Columns[0].ColumnName.Trim(); } dv.Sort = ViewState["sortDepotSeatstring"].ToString(); this.gvDepotSeat.DataSource = dv; this.gvDepotSeat.DataBind(); }
/// <summary> /// 确认 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSaveOrder_Click(object sender, EventArgs e) { if (Session["storageList"] == null || Session["storageList"].ToString() == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001992", "对不起,您所填写的入库产品的数量不能全部是0!"))); return; } else { if (ddlProvider.SelectedValue == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006009", "对不起,请选择供应商!"))); return; } if (ddlDepotSeat.SelectedValue == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001934", "对不起,请选择库位!"))); return; } DateTime dt = MYDateTime1.GetCurrentDateTime(); ///获取新的订单号 string availableOrderID = StorageInBLL.GetNewOrderID(EnumOrderFormType.InStorage); if (txtpici.Text == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002027", "填写批次"))); return; } ///通过批次通过入库批次获取入库批次行数 int getCount = StorageInBLL.GetCountByBatchCode(txtpici.Text.Trim()); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001995", "批次已存在!"))); return; } var boolvalue = GetOrderInfo(); if (!boolvalue) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("正确填入产品数量!")); return; } using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { string makeman = StorageInBLL.GetManageNameByNumber(Session["Company"].ToString()); int docTypeId = StorageInBLL.GetDocTypeIDByDocTypeName("RK"); if (ddlWareHouse.Enabled == false || ddlDepotSeat.Enabled == false) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001999", "对不起,没有可选仓库或库位!"))); return; } else { /// <summary> /// 实例化库存单据模型 /// </summary> InventoryDocModel inventoryDocModel = new InventoryDocModel ( docTypeId, availableOrderID, dt, makeman, Convert.ToInt32(ddlProvider.SelectedValue), "", Convert.ToInt32(ddlWareHouse.SelectedValue), Convert.ToInt32(ddlDepotSeat.SelectedValue), Convert.ToDouble(ViewState["zongPrice"]), Convert.ToDouble(ViewState["totalPV"]), "", CommonDataBLL.getMaxqishu(), "RK", txtMemo.Text.Trim(), 0, txtpici.Text.Trim(), txtOperationPerson.Text.Trim() ); inventoryDocModel.OriginalDocID = this.txtOriginalDocID.Text.Trim(); inventoryDocModel.Address = this.txtAddress.Text.Trim(); //inventoryDocModel.Currency = StorageInBLL.GetMoreStandardMoneyIDByCountryCode(ddlCountry.SelectedValue); //inventoryDocModel.PayCurrency = StorageInBLL.GetMoreCurrencyIDByCountryCode(ddlCountry.SelectedValue); //inventoryDocModel.PayMoney = Convert.ToDecimal(ViewState["zongPrice"]) * StorageInBLL.GetRate_TimesForStandardMoneyByCountryCode(ddlCountry.SelectedValue); inventoryDocModel.OperateIP = CommonDataBLL.OperateIP; inventoryDocModel.OperateNum = CommonDataBLL.OperateBh; ///生成一个单据入库 StorageInBLL.CreateInventoryDoc_WH(tran, inventoryDocModel); foreach (InventoryDocDetailsModel InventoryDocDetails in list)//(ArrayList)ViewState["list"] { InventoryDocDetails.DocID = availableOrderID; } ///向单据明细表中插入相关记录 StorageInBLL.CreateBillofDocumentDetails(tran, list); tran.Commit(); } } catch { tran.Rollback(); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002010", "入库单申请失败,请联系管理员!"))); return; } finally { conn.Close(); } } ScriptManager.RegisterStartupScript(this, GetType(), "abs", "alert('" + GetTran("002015", "入库单申请完成,等待管理员审核!") + "');location.href='StorageInBrowse.aspx'", true); } }
/// <summary> /// 确认 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSaveOrder_Click(object sender, EventArgs e) { if (Session["storageList"] == null || Session["storageList"].ToString() == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001992", "对不起,您所填写的入库产品的数量不能全部是0!"))); return; } else { if (ddlProvider.SelectedValue == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006009", "对不起,请选择供应商!"))); return; } if (ddlDepotSeat.SelectedValue == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001934", "对不起,请选择库位!"))); return; } if (txtpici.Text == "") { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002027", "填写批次"))); return; } ///通过批次通过入库批次获取入库批次行数 var boolvalue = GetOrderInfo(); if (!boolvalue) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("正确填入产品数量!")); return; } DateTime dt = MYDateTime1.GetCurrentDateTime(); string BatchCode = this.txtpici.Text.ToString(); string availableOrderID = ViewState["billId"].ToString(); int i = StorageInBLL.CheckBatch(availableOrderID, BatchCode); if (i > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001995", "批次已存在!"))); return; } string makeman = CommonDataBLL.GetNameByAdminID(Session["Company"].ToString()); int n = 0; InventoryDocModel idm = new InventoryDocModel(); idm.Provider = Convert.ToInt32(ddlProvider.SelectedValue); idm.WareHouseID = Convert.ToInt32(this.ddlWareHouse.SelectedValue); idm.DepotSeatID = Convert.ToInt32(this.ddlDepotSeat.SelectedValue); idm.TotalMoney = Convert.ToDouble(ViewState["zongPrice"]); idm.TotalPV = Convert.ToDouble(ViewState["totalPV"]); idm.ExpectNum = CommonDataBLL.getMaxqishu(); idm.Note = this.txtMemo.Text.ToString(); idm.BatchCode = this.txtpici.Text.ToString(); idm.OperationPerson = this.txtOperationPerson.Text.ToString(); idm.DocID = ViewState["billId"].ToString(); idm.Address = this.txtAddress.Text.ToString(); idm.OriginalDocID = this.txtOriginalDocID.Text.ToString(); idm.OperateIP = CommonDataBLL.OperateIP; idm.OperateNum = CommonDataBLL.OperateBh; ChangeLogs cl = new ChangeLogs("InventoryDoc", "DocID"); cl.AddRecord(idm.DocID); n = StorageInBLL.updAndSaveOrder(idm, list);//(ArrayList)ViewState["list"] if (n > 0) { cl.AddRecord(idm.DocID); cl.ModifiedIntoLogs(ChangeCategory.company8, Session["Company"].ToString(), ENUM_USERTYPE.objecttype0); ScriptManager.RegisterStartupScript(this, GetType(), "abs", "alert('" + GetTran("004179", "入库单编辑完成,等待管理员审核!") + "');location.href='StorageInBrowse.aspx'", true); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("004180", "入库单编辑失败,请准确填写!"))); } } }