protected void Page_Load(object sender, EventArgs e) { strID = Request.QueryString["ID"] + ""; if (!IsPostBack) { BindDropDownList(); if (strID != "") { DataTable dt = bll.FillDataTable("Cmd.SelectProduct", new DataParameter[] { new DataParameter("{0}", string.Format("ProductCode='{0}'", strID)) }); BindData(dt); SetTextReadOnly(this.txtID); } else { this.txtID.Text = bll.GetNewID("CMD_Product", "ProductCode", "1=1"); this.txtCreator.Text = Session["EmployeeCode"].ToString(); this.txtUpdater.Text = Session["EmployeeCode"].ToString(); this.txtCreatDate.Text = ToYMD(DateTime.Now); this.txtUpdateDate.Text = ToYMD(DateTime.Now); } writeJsvar(FormID, SqlCmd, strID); SetTextReadOnly(this.txtCreator, this.txtCreatDate, this.txtUpdater, this.txtUpdateDate); } }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataRow dr; DataTable dtArea = bll.FillDataTable("Cmd.SelectArea"); dr = dtArea.NewRow(); dr["AreaCode"] = ""; dr["AreaName"] = "请选择"; dtArea.Rows.InsertAt(dr, 0); dtArea.AcceptChanges(); this.ddlArea.DataValueField = "AreaCode"; this.ddlArea.DataTextField = "AreaName"; this.ddlArea.DataSource = dtArea; this.ddlArea.DataBind(); DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')") }); dr = dtBillType.NewRow(); dr["BillTypeCode"] = ""; dr["BillTypeName"] = "请选择"; dtBillType.Rows.InsertAt(dr, 0); dtBillType.AcceptChanges(); this.ddlBillType.DataValueField = "BillTypeCode"; this.ddlBillType.DataTextField = "BillTypeName"; this.ddlBillType.DataSource = dtBillType; this.ddlBillType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string WareHouse = Request.QueryString["WareHouse"].ToString(); string ShelfCode = Request.QueryString["ShelfCode"].ToString(); string AreaCode = Request.QueryString["AreaCode"].ToString(); BLL.BLLBase bll = new BLL.BLLBase(); writeJsvar("", "", ""); DataTable tableCell; if (WareHouse != "" && AreaCode == "") { tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByWareHouse", new DataParameter[] { new DataParameter("@WareHouse", WareHouse) }); ShowWareHouseChart(tableCell); } else if (AreaCode != "" && ShelfCode == "") { tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByArea", new DataParameter[] { new DataParameter("@AreaCode", AreaCode) }); ShowCellChart(tableCell); } else { tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByShelf", new DataParameter[] { new DataParameter("{0}", string.Format("ShelfCode='{0}' and AreaCode='{1}'", ShelfCode, AreaCode)) }); ShowCellChart(tableCell); } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Resize", "resize();", true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["CMD_WH_AREA_ID"] != null) { dtArea = bll.FillDataTable("Cmd.SelectArea", new DataParameter[] { new DataParameter("{0}", "AreaCode='" + Request.QueryString["CMD_WH_AREA_ID"] + "'") }); if (this.dtArea.Rows.Count > 0) { this.txtWHID.Text = dtArea.Rows[0]["WarehouseCode"].ToString(); this.txtAreaID.Text = dtArea.Rows[0]["AreaCode"].ToString(); this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'"); this.txtAreaCode.Text = dtArea.Rows[0]["AreaCode"].ToString(); this.txtAreaName.Text = dtArea.Rows[0]["AreaName"].ToString(); this.txtMemo.Text = dtArea.Rows[0]["MEMO"].ToString(); } } else if (Request.QueryString["WHCODE"] != null) { this.txtWHID.Text = Request.QueryString["WHCODE"]; this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'"); this.txtAreaID.Text = ""; this.txtAreaCode.Text = bll.GetNewID("CMD_Area", "AreaCode", "1=1"); } SetTextReadOnly(this.txtAreaCode, this.txtWhName, this.txtWHID); } else { } }
protected void Page_Load(object sender, EventArgs e) { strID = Request.QueryString["ID"] + ""; this.dgViewSub1.PageSize = pageSubSize; if (!IsPostBack) { BindDropDownList(); if (strID != "") { DataTable dt = bll.FillDataTable("WMS.SelectBillMaster", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", strID)) }); BindData(dt); SetTextReadOnly(this.txtID); } else { BindDataSub(); txtBillDate.changed = "$('#txtID').val(autoCodeByTableName('IS', '1=1','WMS_BillMaster', 'txtBillDate'));"; this.txtBillDate.DateValue = DateTime.Now; this.txtID.Text = bll.GetAutoCodeByTableName("IS", "WMS_BillMaster", DateTime.Now, "1=1"); this.txtCreator.Text = Session["EmployeeCode"].ToString(); this.txtUpdater.Text = Session["EmployeeCode"].ToString(); this.txtCreatDate.Text = ToYMD(DateTime.Now); this.txtUpdateDate.Text = ToYMD(DateTime.Now); } } ScriptManager.RegisterStartupScript(this.updatePanel1, this.updatePanel1.GetType(), "Resize", "resize();BindEvent();", true); writeJsvar(FormID, SqlCmd, strID); SetTextReadOnly(this.txtTotalQty, this.txtCreator, this.txtCreatDate, this.txtUpdater, this.txtUpdateDate); }
protected void Page_Load(object sender, EventArgs e) { string UserID = Request.QueryString["UserID"].ToString();; SetTextReadOnly(this.txtUserName); if (!Page.IsPostBack) { DataTable dtuser = bll.FillDataTable("Security.SelectUser", new DataParameter[] { new DataParameter("{0}", string.Format("UserID={0}", UserID)) }); if (dtuser.Rows.Count > 0) { this.txtUserID.Value = UserID; this.txtUserName.Text = dtuser.Rows[0]["UserName"].ToString(); } BindWarehouse(); DataTable dtUserArea = bll.FillDataTable("Security.SelectUserArea", new DataParameter[] { new DataParameter("@UserID", UserID) }); foreach (ListItem cbox in chkArea.Items) { DataRow[] drs = dtUserArea.Select("AreaCode=" + cbox.Value); if (drs.Length > 0) { cbox.Selected = true; } } } }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtArea = bll.FillDataTable("Cmd.SelectArea", new DataParameter[] { new DataParameter("{0}", "1=1") }); DataRow dr = dtArea.NewRow(); dr["AreaCode"] = ""; dr["AreaName"] = "请选择"; dtArea.Rows.InsertAt(dr, 0); dtArea.AcceptChanges(); this.ddlArea.DataValueField = "AreaCode"; this.ddlArea.DataTextField = "AreaName"; this.ddlArea.DataSource = dtArea; this.ddlArea.DataBind(); DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')"), new DataParameter("{1}", "BillTypeCode") }); dr = dtBillType.NewRow(); dr["BillTypeCode"] = ""; dr["BillTypeName"] = "请选择"; dtBillType.Rows.InsertAt(dr, 0); dtBillType.AcceptChanges(); this.ddlBillType.DataValueField = "BillTypeCode"; this.ddlBillType.DataTextField = "BillTypeName"; this.ddlBillType.DataSource = dtBillType; this.ddlBillType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDropDownList(); if (Request.QueryString["CMD_CELL_ID"] != null) { dtCell = bll.FillDataTable("Cmd.SelectCell", new DataParameter[] { new DataParameter("{0}", "CellCode='" + Request.QueryString["CMD_CELL_ID"] + "'") }); this.txtCELLID.Text = dtCell.Rows[0]["CellCode"].ToString(); this.txtShelfID.Text = dtCell.Rows[0]["ShelfCode"].ToString(); this.txtAreaID.Text = dtCell.Rows[0]["AreaCode"].ToString(); this.txtShelfName.Text = bll.GetFieldValue("CMD_Shelf", "ShelfName", "ShelfCode='" + this.txtShelfID.Text + "'"); ddlAreaCode.SelectedValue = this.txtAreaID.Text; this.txtCellCode.Text = dtCell.Rows[0]["CellCode"].ToString(); this.txtCellName.Text = dtCell.Rows[0]["CellName"].ToString(); this.ddlActive.SelectedValue = dtCell.Rows[0]["IsActive"].ToString(); this.txtCellRows.Text = dtCell.Rows[0]["CellRow"].ToString(); this.txtCellCols.Text = dtCell.Rows[0]["CellColumn"].ToString(); this.ddlLock.SelectedValue = dtCell.Rows[0]["IsLock"].ToString(); this.txtMemo.Text = dtCell.Rows[0]["MEMO"].ToString(); int count = bll.GetRowCount("View_CMD_CELL_ALL", "CellCode='" + this.txtCELLID.Text + "' and PalletCode!=''"); if (count > 0) { this.btnSave.Enabled = false; } } else if (Request.QueryString["SHELFCODE"] != null) { this.txtShelfID.Text = Request.QueryString["SHELFCODE"]; this.txtAreaID.Text = bll.GetFieldValue("CMD_Shelf", "AreaCode", "ShelfCode='" + this.txtShelfID.Text + "'"); this.txtShelfName.Text = bll.GetFieldValue("CMD_Shelf", "ShelfName", "ShelfCode='" + this.txtShelfID.Text + "'"); this.ddlAreaCode.SelectedValue = this.txtAreaID.Text; int RowCount = bll.GetRowCount("CMD_WH_CELL", string.Format("SHELF_CODE='{0}'", Request.QueryString["SHELFCODE"])) + 1; this.txtCellCode.Text = Request.QueryString["SHELFCODE"] + RowCount.ToString().PadLeft(3, '0'); this.txtCellCols.Text = RowCount.ToString(); this.txtCELLID.Text = ""; //this.txtEGroup.Text = "0"; //this.txtECom.Text = "0"; //this.txtEAddress.Text = "0"; } SetTextReadOnly(this.txtCellName, this.txtCellCode, this.txtShelfName, this.txtCellCols, this.txtCellRows); } else { } }
protected void Page_Load(object sender, EventArgs e) { strID = Request.QueryString["ID"] + ""; if (!IsPostBack) { BindDropDownList(); DataTable dt = bll.FillDataTable("Cmd.SelectProduct", new DataParameter[] { new DataParameter("{0}", string.Format("ProductCode='{0}'", strID)) }); BindData(dt); writeJsvar(FormID, SqlCmd, strID); } }
public void InitSmartTree() { this.sTreeModule.Nodes.Clear(); DataTable dtModules = bll.FillDataTable("Security.SelectSystemModules", new DataParameter[] { new DataParameter("@SystemName", "WMS") }); DataTable dtSubModules = bll.FillDataTable("Security.SelectSystemSubModules", new DataParameter[] { new DataParameter("@SystemName", "WMS") }); DataTable dtOperations = bll.FillDataTable("Security.SelectSystemOperations", new DataParameter[] { new DataParameter("@SystemName", "WMS") }); foreach (DataRow dr in dtModules.Rows) { TreeNode tnRoot = new TreeNode(dr["MenuTitle"].ToString(), dr["ModuleCode"].ToString().Trim()); tnRoot.SelectAction = TreeNodeSelectAction.Expand; tnRoot.ShowCheckBox = true; this.sTreeModule.Nodes.Add(tnRoot); } //为第一级菜单增加子级菜单 if (dtModules.Rows.Count > 0) { foreach (DataRow drSub in dtSubModules.Rows) { for (int i = 0; i < sTreeModule.Nodes.Count; i++) { if (sTreeModule.Nodes[i].Value == drSub["ModuleCode"].ToString().Trim()) { TreeNode tnChild = new TreeNode(drSub["MenuTitle"].ToString(), drSub["SubModuleCode"].ToString().Trim()); tnChild.ShowCheckBox = true; tnChild.SelectAction = TreeNodeSelectAction.Expand; this.sTreeModule.Nodes[i].ChildNodes.Add(tnChild); break; } } } } foreach (DataRow drOp in dtOperations.Rows) { for (int i = 0; i < sTreeModule.Nodes.Count; i++) { for (int j = 0; j < sTreeModule.Nodes[i].ChildNodes.Count; j++) { if (sTreeModule.Nodes[i].ChildNodes[j].Value == drOp["SubModuleCode"].ToString().Trim()) { TreeNode tnOp = new TreeNode(drOp["OperatorDescription"].ToString(), drOp["ModuleID"].ToString()); tnOp.ShowCheckBox = true; tnOp.SelectAction = TreeNodeSelectAction.None; sTreeModule.Nodes[i].ChildNodes[j].ChildNodes.Add(tnOp); } } } } }
protected void Page_Load(object sender, EventArgs e) { strID = Request.QueryString["ID"] + ""; this.dgViewSub1.PageSize = pageSubSize; if (!IsPostBack) { BindDropDownList(); DataTable dt = bll.FillDataTable("WMS.SelectBillMaster", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", strID)) }); BindData(dt); } ScriptManager.RegisterStartupScript(this.updatePanel, this.updatePanel.GetType(), "Resize", "resize();", true); writeJsvar(FormID, SqlCmd, strID); }
private void BindData(string PalletCode) { DataTable dt = bll.FillDataTable("WMS.SelectWmsPallet", new DataParameter[] { new DataParameter("{0}", string.Format("PalletCode='{0}'", PalletCode)) }); if (dt.Rows.Count > 0) { this.txtCellCode.Text = dt.Rows[0]["CellCode"].ToString(); if (this.txtCellCode.Text.Length > 0) { this.btnAddDetail.Enabled = false; this.btnDelDetail.Enabled = false; this.btnSave.Enabled = false; } else { this.btnAddDetail.Enabled = true; this.btnDelDetail.Enabled = true; this.btnSave.Enabled = true; } } else { this.txtCellCode.Text = ""; this.btnAddDetail.Enabled = true; this.btnDelDetail.Enabled = true; this.btnSave.Enabled = true; } ViewState[FormID + "_Edit_dgViewSub1"] = dt; this.dgViewSub1.DataSource = dt; this.dgViewSub1.DataBind(); MovePage("Edit", this.dgViewSub1, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1); }
private void QuickDestopBind() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtOP = bll.FillDataTable("Security.SelectUserQuickDesktop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) }); foreach (TreeNode tnRoot in this.sTreeModule.Nodes) { bool IsAllSelected = false; foreach (TreeNode tnSub in tnRoot.ChildNodes) { tnSub.Checked = false; DataRow[] drs = dtOP.Select(string.Format("ModuleID={0}", tnSub.Value)); if (drs.Length > 0) { tnSub.Checked = true; } if (tnSub.Checked) { IsAllSelected = true; } } if (IsAllSelected) { tnRoot.Checked = true; } } }
public ReturnData strBaseData(string xmlpara) { ReturnData rr = new ReturnData(); DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara); string strWhere = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strWhere"].ToString()); string strFieldName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strFieldName"].ToString()); string TableName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["TableName"].ToString());; if (strFieldName == "") { strFieldName = "*"; } BLL.BLLBase bll = new BLL.BLLBase(); dt = bll.FillDataTable("Security.SelectFieldValue", new DataParameter[] { new DataParameter("{0}", TableName), new DataParameter("{1}", strFieldName), new DataParameter("{2}", strWhere) }); rr.data = Util.JsonHelper.Dtb2Json(dt); rr.type = "" + dt.GetType(); return(rr); }
protected void btnUnTask_Click(object sender, EventArgs e) { BLL.BLLBase bll = new BLL.BLLBase(); int State = int.Parse(bll.GetFieldValue("WMS_BillMaster", "State", string.Format("BillID='{0}'", this.txtID.Text))); if (State < 2) { JScript.ShowMessage(this.updatePanel, this.txtID.Text + "单号还未作业,不能进行取消作业。"); return; } if (State > 2) { JScript.ShowMessage(this.updatePanel, this.txtID.Text + "单号已经执行,不能再进行取消作业。"); return; } try { bll.ExecNonQueryTran("WMS.SpCancelOutStockTask", new DataParameter[] { new DataParameter("@BillID", strID), new DataParameter("@UserName", Session["EmployeeCode"].ToString()) }); AddOperateLog("入库单", "入库取消作业单号:" + this.txtID.Text); DataTable dt = bll.FillDataTable("WMS.SelectBillMaster", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", strID)) }); BindData(dt); } catch (Exception ex) { JScript.ShowMessage(this.updatePanel, ex.Message); } }
private void Main_Load(object sender, EventArgs e) { try { bll = new BLLBase(); lbLog.Scrollable = true; Logger.OnLog += new LogEventHandler(Logger_OnLog); context = new Context(); ContextInitialize initialize = new ContextInitialize(); initialize.InitializeContext(context); Dispatching.LED2008.LEDUtil.Initialize(context.Attributes["LedCollection"].ToString()); toolStripButton_StartCrane_Click(null, null); dtCrane = bll.FillDataTable("WCS.SelectWCSCRANE"); System.Threading.Thread.Sleep(1000); tmCraneErr.Interval = 3000; tmCraneErr.Elapsed += new System.Timers.ElapsedEventHandler(tmCraneWorker); tmCraneErr.Start(); } catch (Exception ee) { Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message); } }
public override void BindDataSub(string BillID) { //string script = string.Format("document.getElementById('iframeRoleSet').src='RoleSet.aspx?GroupID={0}&GroupName={1}' ;", this.hdnRowValue.Value, Server.UrlEncode(hdnRowGroupName.Value)); //ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "", script, true); string GroupName = hdnRowGroupName.Value; this.lbTitle.Text = "用户组 <font color='Gray'>" + GroupName + "</font> 权限设置"; //InitSmartTree(); //this.sTreeModule.ExpandDepth = 1; GroupOperationBind(); if (GroupName == "admin") { this.lnkBtnSave.Enabled = false; } else { this.lnkBtnSave.Enabled = true; } BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtSub = bll.FillDataTable("Security.SelectGroupUser", new DataParameter[] { new DataParameter("@GroupID", BillID) }); ViewState[FormID + "_S_gvGroupListUser"] = dtSub; this.gvGroupListUser.DataSource = dtSub; this.gvGroupListUser.DataBind(); MovePage("S", this.gvGroupListUser, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1); lblCurrentPageSub1.Visible = false; }
private bool LoadRpt1() { try { strWhere = "1=1"; strWhere += string.Format("and CellCode between '{0}' AND '{1}'", SelectBegin.Text, SelectEnd.Text); string frx = "BarCodeQuery.frx"; string Comds = "Cmd.SelectCell"; WebReport2.Report = new Report(); WebReport2.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) }); if (dt.Rows.Count == 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true); } WebReport2.Report.RegisterData(dt, "BarCode"); } catch (Exception ex) { } return(true); }
private bool LoadRpt() { try { GetStrWhere(); string frx = "ProductDetailQuery.frx"; string Comds = "WMS.SelectProductDetailQuery"; if (rpt2.Checked) { frx = "ProductTotalQuery.frx"; Comds = "WMS.SelectProductTotalQuery"; } WebReport1.Report = new Report(); WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) }); if (dt.Rows.Count == 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true); } WebReport1.Report.RegisterData(dt, "ProductQuery"); } catch (Exception ex) { } return(true); }
public void InitSmartTree() { this.sTreeModule.Nodes.Clear(); try { string strUserName = Session["G_User"].ToString(); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtModules = bll.FillDataTable("Security.SelectUserOperateModule", new DataParameter[] { new DataParameter("@UserName", strUserName) }); DataTable dtSubModules = bll.FillDataTable("Security.SelectUserOperateSubModule", new DataParameter[] { new DataParameter("@UserName", strUserName) }); foreach (DataRow dr in dtModules.Rows) { TreeNode tnRoot = new TreeNode(dr["MenuTitle"].ToString(), dr["ID"].ToString()); tnRoot.SelectAction = TreeNodeSelectAction.Expand; tnRoot.ShowCheckBox = true; this.sTreeModule.Nodes.Add(tnRoot); } if (dtModules.Rows.Count > 0) { foreach (DataRow drSub in dtSubModules.Rows) { for (int i = 0; i < sTreeModule.Nodes.Count; i++) { if (sTreeModule.Nodes[i].Text == drSub["MenuParent"].ToString()) { TreeNode tnChild = new TreeNode(drSub["MenuTitle"].ToString(), drSub["ID"].ToString()); tnChild.ShowCheckBox = true; tnChild.SelectAction = TreeNodeSelectAction.Expand; this.sTreeModule.Nodes[i].ChildNodes.Add(tnChild); break; } } } } } catch (Exception e) { Session["ModuleName"] = "浏览公共模块"; Session["FunctionName"] = "Page_Load"; Session["ExceptionalType"] = e.GetType().FullName; Session["ExceptionalDescription"] = e.Message; Response.Redirect("~/Common/MistakesPage.aspx"); } }
public override void BindDataSub(string BillID) { BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtSub = bll.FillDataTable("WMS.SelectBillDetail", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", BillID)) }); ViewState[FormID + "_S_GridView2"] = dtSub; this.GridView2.DataSource = dtSub; this.GridView2.DataBind(); MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1); }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='001' AND IsFixed !='1'") }); DataRow dr = ProductType.NewRow(); dr["CategoryCode"] = ""; dr["CategoryName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "CategoryCode"; this.ddlProductType.DataTextField = "CategoryName"; this.ddlProductType.DataSource = ProductType; this.ddlProductType.DataBind(); DataTable dtArea = bll.FillDataTable("Cmd.SelectArea"); dr = dtArea.NewRow(); dr["AreaCode"] = ""; dr["AreaName"] = "请选择"; dtArea.Rows.InsertAt(dr, 0); dtArea.AcceptChanges(); this.ddlArea.DataValueField = "AreaCode"; this.ddlArea.DataTextField = "AreaName"; this.ddlArea.DataSource = dtArea; this.ddlArea.DataBind(); DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')") }); dr = dtBillType.NewRow(); dr["BillTypeCode"] = ""; dr["BillTypeName"] = "请选择"; dtBillType.Rows.InsertAt(dr, 0); dtBillType.AcceptChanges(); this.ddlBillType.DataValueField = "BillTypeCode"; this.ddlBillType.DataTextField = "BillTypeName"; this.ddlBillType.DataSource = dtBillType; this.ddlBillType.DataBind(); }
public override void BindDataSub(string BillID) { BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtSub = bll.FillDataTable("WMS.SelectBillTask", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", BillID)) }); ViewState[FormID + "_S_GridView2"] = dtSub; this.GridView2.DataSource = dtSub; this.GridView2.DataBind(); MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["WAREHOUSE_CODE"] != null) { dtHouse = bll.FillDataTable("Cmd.SelectWarehouse", new DataParameter[] { new DataParameter("{0}", "WarehouseCode='" + Request.QueryString["WAREHOUSE_CODE"] + "'") }); this.txtWHID.Text = dtHouse.Rows[0]["WarehouseCode"].ToString(); this.txtWhCode.Text = dtHouse.Rows[0]["WarehouseCode"].ToString(); this.txtWhName.Text = dtHouse.Rows[0]["WarehouseName"].ToString(); this.txtMemo.Text = dtHouse.Rows[0]["MEMO"].ToString(); SetTextReadOnly(this.txtWhCode); } else { this.txtWHID.Text = ""; this.txtWhCode.Text = bll.GetNewID("CMD_WAREHOUSE", "WarehouseCode", "1=1"); } } }
private void BindDropDownList() { DataTable ProductType = bll.FillDataTable("Cmd.SelectProductCategory"); DataRow dr = ProductType.NewRow(); dr["CategoryCode"] = ""; dr["CategoryName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); this.ddlProductCategory.DataValueField = "CategoryCode"; this.ddlProductCategory.DataTextField = "CategoryName"; this.ddlProductCategory.DataSource = ProductType; this.ddlProductCategory.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["CMD_WH_SHELF_ID"] != null) { dtShelf = bll.FillDataTable("Cmd.SelectCellShelf", new DataParameter[] { new DataParameter("{0}", " ShelfCode='" + Request.QueryString["CMD_WH_SHELF_ID"] + "'") }); this.txtShelfID.Text = dtShelf.Rows[0]["ShelfCode"].ToString(); this.txtWHID.Text = dtShelf.Rows[0]["WarehouseCode"].ToString(); this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'"); this.txtAreaID.Text = dtShelf.Rows[0]["AreaCode"].ToString(); this.txtShelfCode.Text = dtShelf.Rows[0]["ShelfCode"].ToString(); this.txtShelfName.Text = dtShelf.Rows[0]["ShelfName"].ToString(); this.txtCellRows.Text = dtShelf.Rows[0]["Rows"].ToString(); this.txtCellCols.Text = dtShelf.Rows[0]["Columns"].ToString(); this.txtMemo.Text = dtShelf.Rows[0]["MEMO"].ToString(); this.ddlActive.SelectedValue = dtShelf.Rows[0]["IsActive"].ToString(); } else if (Request.QueryString["AREACODE"] != null) { this.txtAreaID.Text = Request.QueryString["AREACODE"]; this.txtWHID.Text = bll.GetFieldValue("CMD_Area", "WarehouseCode", "AreaCode='" + this.txtAreaID.Text + "'"); this.txtWhName.Text = bll.GetFieldValue("CMD_Warehouse", "WarehouseName", "WarehouseCode='" + this.txtWHID.Text + "'"); this.txtShelfID.Text = ""; int RowCount = bll.GetRowCount("CMD_WH_SHELF", string.Format("AREA_CODE='{0}'", Request.QueryString["AREACODE"])) + 1; this.txtShelfCode.Text = Request.QueryString["AREACODE"] + RowCount.ToString().PadLeft(3, '0'); } SetTextReadOnly(txtShelfCode, this.txtWhName, this.txtCellCols, this.txtCellRows); } }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", " IsFixed<>'1'") }); DataRow dr = ProductType.NewRow(); dr["CategoryCode"] = ""; dr["CategoryName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "CategoryCode"; this.ddlProductType.DataTextField = "CategoryName"; this.ddlProductType.DataSource = ProductType; this.ddlProductType.DataBind(); }
private void BindDropDownList() { DataTable dtArea = bll.FillDataTable("Security.SelectUserAreaByWhere", new DataParameter[] { new DataParameter("{0}", string.Format("UserName='******'", Session["G_user"].ToString())) }); this.ddlArea.DataTextField = "AreaName"; this.ddlArea.DataValueField = "AreaCode"; this.ddlArea.DataSource = dtArea; this.ddlArea.DataBind(); if (dtArea.Rows.Count > 1) { this.ddlArea.Items.Insert(0, new ListItem("", "")); } if (this.ddlArea.Items.Count > 0) { this.ddlArea.SelectedIndex = 0; } }
protected void ddlAreaCode_SelectedIndexChanged(object sender, EventArgs e) { string AreaCode = ddlArea.SelectedValue; BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='" + AreaCode + "' AND IsFixed !='1'") }); DataRow dr = ProductType.NewRow(); dr["CategoryCode"] = ""; dr["CategoryName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "CategoryCode"; this.ddlProductType.DataTextField = "CategoryName"; this.ddlProductType.DataSource = ProductType; this.ddlProductType.DataBind(); }
public ReturnData GetCellInfo(string xmlpara) { ReturnData rr = new ReturnData(); try { DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara); string CellCode = dt.Rows[0]["CellCode"].ToString(); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", CellCode) }); string str = Util.JsonHelper.Dtb2Json(dtCell); rr.data = str; rr.type = "" + dtCell.GetType(); } catch (Exception ex) { } return(rr); }
protected void Page_Load(object sender, EventArgs e) { strID = Request.QueryString["ID"] + ""; if (!IsPostBack) { BindDropDownList(); if (strID != "") { DataTable dt = bll.FillDataTable("Cmd.SelectCar", new DataParameter[] { new DataParameter("{0}", string.Format("CarNo='{0}'", strID)) }); BindData(dt); SetTextReadOnly(this.txtID); } else { this.txtID.Text = bll.GetNewID("CMD_Car", "CarNo", "1=1"); } writeJsvar(FormID, SqlCmd, strID); } }
private bool LoadRpt() { try { GetStrWhere(); string frx = "MoldStrokeTotal.frx"; string Comds = "WMS.SelectProductAllWeight"; if (rpt2.Checked) { strWhere += "and tmp.quantity>=product.Weight "; } if (rpt3.Checked) { strWhere += "and isnull(tmp.quantity,0)<product.Weight"; } WebReport1.Report = new Report(); WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) }); if (dt.Rows.Count == 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true); } WebReport1.Report.RegisterData(dt, "StrokeTotal"); } catch (Exception ex) { } return(true); }
private bool LoadRpt() { try { GetStrWhere(); string frx = "ProductDetailQuery.frx"; string Comds = "WMS.SelectProductDetailQuery"; if (rpt2.Checked) { frx = "ProductTotalQuery.frx"; Comds = "WMS.SelectProductTotalQuery"; } WebReport1.Report = new Report(); WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) }); if (dt.Rows.Count == 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true); } WebReport1.Report.RegisterData(dt, "ProductQuery"); } catch (Exception ex) { } return true; }
protected void Page_PreLoad(object sender, EventArgs e) { #region 权限控制 try { if (Session["SubModuleCode"] != null) { string[] path = this.Page.Request.Path.Split('/'); if (path.Length > 0) { if (path[path.Length - 1].IndexOf(FormID + "s", 0) >= 0) //s { if ((Button)Page.FindControl("btnAdd") != null) ((Button)Page.FindControl("btnAdd")).Enabled = false; if ((Button)Page.FindControl("btnDelete") != null) ((Button)Page.FindControl("btnDelete")).Enabled = false; if ((Button)Page.FindControl("btnPrint") != null) ((Button)Page.FindControl("btnPrint")).Enabled = false; } if (path[path.Length - 1].IndexOf(FormID + "View", 0) >= 0) { if ((Button)Page.FindControl("btnAdd") != null) ((Button)Page.FindControl("btnAdd")).Enabled = false; if ((Button)Page.FindControl("btnDelete") != null) ((Button)Page.FindControl("btnDelete")).Enabled = false; if ((Button)Page.FindControl("btnEdit") != null) ((Button)Page.FindControl("btnEdit")).Enabled = false; if ((Button)Page.FindControl("btnPrint") != null) ((Button)Page.FindControl("btnPrint")).Enabled = false; } } if (Session["DT_UserOperation"] == null) { BLL.BLLBase bll = new BLL.BLLBase(); int iGroupID = int.Parse(Session["GroupID"].ToString()); DataTable dt = bll.FillDataTable("Security.SelectGroupRole", new DataParameter[] { new DataParameter("@GroupID", iGroupID), new DataParameter("@SystemName", "WMS") }); Session["DT_UserOperation"] = dt; } DataTable dtOP = (DataTable)(Session["DT_UserOperation"]); DataRow[] drs = dtOP.Select(string.Format("SubModuleCode='{0}'", Session["SubModuleCode"].ToString())); foreach (DataRow dr in drs) { Session["SubModuleTitle"] = drs[0]["MenuTitle"].ToString(); SubModuleTitle = Session["SubModuleTitle"].ToString(); int op = int.Parse(dr["OperatorCode"].ToString()); switch (op) { case 0: if ((Button)Page.FindControl("btnAdd") != null) { ((Button)Page.FindControl("btnAdd")).Enabled = true; } break; case 1: if ((Button)Page.FindControl("btnDelete") != null) { ((Button)Page.FindControl("btnDelete")).Enabled = true; } break; case 2: //修改 if ((HiddenField)Page.FindControl("hdnXGQX") != null) { ((HiddenField)Page.FindControl("hdnXGQX")).Value = "1"; } if ((Button)Page.FindControl("btnEdit") != null) { ((Button)Page.FindControl("btnEdit")).Enabled = true; } break; case 3: //打印 if ((Button)Page.FindControl("btnPrint") != null) { ((Button)Page.FindControl("btnPrint")).Enabled = true; } break; case 4: //抛出 if ((Button)Page.FindControl("btnExport") != null) { ((Button)Page.FindControl("btnExport")).Enabled = true; } break; case 5: //审核 if ((Button)Page.FindControl("btnCheck") != null) { ((Button)Page.FindControl("btnCheck")).Enabled = true; } break; case 6: //二审 if ((Button)Page.FindControl("btnReCheck") != null) { ((Button)Page.FindControl("btnReCheck")).Enabled = true; } break; case 7: //关闭 if ((Button)Page.FindControl("btnClose") != null) { ((Button)Page.FindControl("btnClose")).Enabled = true; } break; case 10: if ((Button)Page.FindControl("btnUpdateClearing") != null) { ((Button)Page.FindControl("btnUpdateClearing")).Enabled = true; } break; default: break; } } } } catch (Exception ex) { JScript.Instance.ShowMessage(Page, ex.Message); } #endregion }
public ReturnData GetCellInfo(string xmlpara) { ReturnData rr = new ReturnData(); try { DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara); string CellCode = dt.Rows[0]["CellCode"].ToString(); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", CellCode) }); string str = Util.JsonHelper.Dtb2Json(dtCell); rr.data = str; rr.type = "" + dtCell.GetType(); } catch (Exception ex) { } return rr; }
public ReturnData strBaseData(string xmlpara) { ReturnData rr = new ReturnData(); DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara); string strWhere = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strWhere"].ToString()); string strFieldName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strFieldName"].ToString()); string TableName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["TableName"].ToString()); ; if (strFieldName == "") strFieldName = "*"; BLL.BLLBase bll = new BLL.BLLBase(); dt = bll.FillDataTable("Security.SelectFieldValue", new DataParameter[] { new DataParameter("{0}", TableName), new DataParameter("{1}", strFieldName), new DataParameter("{2}", strWhere) }); rr.data = Util.JsonHelper.Dtb2Json(dt); rr.type = "" + dt.GetType(); return rr; }
//货架显示图; protected Table CreateShelfChart(string AreaCode, string shelfCode) { BLL.BLLBase bll = new BLL.BLLBase(); string strWhere = ""; if (AreaCode == "") strWhere = string.Format("ShelfCode='{0}'", shelfCode); else strWhere = string.Format("ShelfCode='{0}' and AreaCode='{1}'", shelfCode, AreaCode); DataTable ShelfCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByShelf", new DataParameter[] { new DataParameter("{0}", strWhere) }); int Rows = int.Parse(ShelfCell.Rows[0]["Rows"].ToString()); int Columns = 45; string Width = "2%"; Table tb = new Table(); string tbstyle = "width:100%"; tb.Attributes.Add("style", tbstyle); //tb.Attributes.Add("display", "table-cell"); for (int i = Rows; i >= 1; i--) { TableRow row = new TableRow(); for (int j = 1; j <=Columns; j++) { //if (j == 1) //{ // if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011") // { // TableCell cellAdd = new TableCell(); // cellAdd.Attributes.Add("style", "height:25px;width:" + Width + ";border:0px solid #008B8B"); // row.Cells.Add(cellAdd); // } //} if (AreaCode == "") strWhere = string.Format("CellRow={0} and CellColumn={1}", i, j); else strWhere = string.Format("CellRow={0} and CellColumn={1} and AreaCode='{2}'", i, j, AreaCode); DataRow[] drs = ShelfCell.Select(strWhere, ""); if (drs.Length > 0) { TableCell cell = new TableCell(); cell.ID = drs[0]["CellCode"].ToString(); string style = "height:25px;width:" + Width + ";border:2px solid #008B8B;"; string backColor = ReturnColorFlag(drs[0]["ProductCode"].ToString(), drs[0]["IsActive"].ToString(), drs[0]["IsLock"].ToString(), drs[0]["ErrorFlag"].ToString(), ToYMD(drs[0]["InDate"])); if (drs[0]["ProductCode"].ToString() != "") { style += "background-color:" + backColor + ";"; } cell.Attributes.Add("style", style); cell.Attributes.Add("onclick", "ShowCellInfo('" + cell.ID + "');"); row.Cells.Add(cell); } else { TableCell cell = new TableCell(); string style = "height:25px;width:" + Width + ";border:0px solid #008B8B"; cell.Attributes.Add("style", style); row.Cells.Add(cell); } if (j == Columns) { //if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode =="001006"||shelfCode == "001007"||shelfCode == "001010" ||shelfCode == "001011") //{ // TableCell cellAdd = new TableCell(); // cellAdd.Attributes.Add("style", "height:25px;width:" + Width + ";border:0px solid #008B8B"); // row.Cells.Add(cellAdd); //} TableCell cellTag = new TableCell(); cellTag.Attributes.Add("style", "height:25px;border:0px solid #008B8B"); cellTag.Attributes.Add("align", "right"); cellTag.Text = "<font color=\"#008B8B\"> 第" + int.Parse(shelfCode.Substring(3, 3)).ToString() + "排第" + i.ToString() + "层</font>"; row.Cells.Add(cellTag); } } tb.Rows.Add(row); if (i == 1) { TableRow rowNum = new TableRow(); for (int j = 1; j <= Columns; j++) { string K = j.ToString(); if (j == 1 ) { if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011") { TableCell cellNum1 = new TableCell(); cellNum1.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B"); cellNum1.Attributes.Add("align", "center"); cellNum1.Attributes.Add("Valign", "top"); rowNum.Cells.Add(cellNum1); continue; } } TableCell cellNum = new TableCell(); cellNum.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B"); cellNum.Attributes.Add("align", "center"); cellNum.Attributes.Add("Valign", "top"); cellNum.Text = "<font color=\"#008B8B\">" + K + "</font>"; rowNum.Cells.Add(cellNum); //if (j == Columns) //{ // if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011") // { // TableCell cellNum1 = new TableCell(); // cellNum1.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B"); // cellNum1.Attributes.Add("align", "center"); // cellNum1.Attributes.Add("Valign", "top"); // rowNum.Cells.Add(cellNum1); // } //} } tb.Rows.Add(rowNum); } } return tb; }