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 GetEff() { DataParameter[] param; param = new DataParameter[] { new DataParameter("{0}", string.Format("CONVERT(varchar(12) , FinishDate, 111 ) between '{0}' and '{1}'", stardate, enddate)) }; DataTable dt = bll.FillDataTable("WCS.SelectTaskEff", param); TimeSpan t1 = dateTimePicker2.Value - dateTimePicker1.Value; int days = t1.Days; for (int i = 0; i < days + 1; i++) { string ymd = dateTimePicker1.Value.AddDays(i).ToString("yyyy-MM-dd"); string d = ymd.Substring(5); Xdate.Add(d); int per; var a = (from DataRow Order in dt.Rows where ((DateTime)Order["FinishDate"]).ToString("yyyy-MM-dd") == ymd select new { finishdate = Order[0], tasktype = Order[1], Time = Order[2] }); int c = a.Sum(x => int.Parse(x.Time.ToString())); if (a.Count() > 0) { per = c / a.Count(); } else { per = 0; } YMin.Add(per); } chart1.Series[0].Points.DataBindXY(Xdate, YMin); result = true; }
public override void Initialize(Context context) { try { //获取堆垛机信息 DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "1=1") }); for (int i = 1; i <= dt.Rows.Count; i++) { if (!dCrnStatus.ContainsKey(i)) { rCrnStatus crnsta = new rCrnStatus(); dCrnStatus.Add(i, crnsta); dCrnStatus[i].TaskNo = ""; dCrnStatus[i].Status = int.Parse(dt.Rows[i - 1]["State"].ToString()); dCrnStatus[i].TaskStatus = 0; dCrnStatus[i].ErrCode = 0; dCrnStatus[i].Action = 0; } } BalanceCounter = int.Parse(context.Attributes["BalanceCounter"].ToString()); tmWorkTimer.Interval = 1000; tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker); base.Initialize(context); } catch (Exception ex) { Logger.Error("Dispatching.Process.Process_Crane.CraneProcess堆垛机初始化出错,原因:" + ex.Message); } }
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(); 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); }
private void frmReassignEmptyCell_Load(object sender, EventArgs e) { this.txtTaskNo.Text = dr["TaskNo"].ToString(); this.txtCellCode.Text = dr["CellCode"].ToString(); this.txtAisleNo.Text = dr["AisleNo"].ToString(); this.txtCraneNo.Text = dr["CraneNo"].ToString(); this.txtCarNo.Text = dr["CarNo"].ToString(); this.txtAreaName.Text = dr["AreaName"].ToString(); this.txtPalletCode.Text = dr["PalletCode"].ToString(); this.txtAreaCode.Text = dr["AreaCode"].ToString(); if (this.txtAreaCode.Text == "002") { Layer = int.Parse(this.txtCellCode.Text.Substring(6, 3)); } DataParameter[] param = new DataParameter[] { new DataParameter("{0}", string.Format("AreaCode='{0}' and AisleNo='{1}'", this.txtAreaCode.Text, this.txtAisleNo.Text)) }; DataTable dt = bll.FillDataTable("CMD.SelectCellShelf", param); this.cbRow.DataSource = dt.DefaultView; this.cbRow.ValueMember = "shelfcode"; this.cbRow.DisplayMember = "shelfcode"; }
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.txtCreator, this.txtCreatDate, this.txtUpdater, this.txtUpdateDate); }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "ProductTypeCode<>'0001'") }); DataRow dr = ProductType.NewRow(); dr["ProductTypeCode"] = ""; dr["ProductTypeName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "ProductTypeCode"; this.ddlProductType.DataTextField = "ProductTypeName"; this.ddlProductType.DataSource = ProductType; this.ddlProductType.DataBind(); DataTable dtStateNo = bll.FillDataTable("Cmd.SelectProductState"); dr = dtStateNo.NewRow(); dr["StateNo"] = ""; dr["StateName"] = "请选择"; dtStateNo.Rows.InsertAt(dr, 0); dtStateNo.AcceptChanges(); this.ddlStateNo.DataValueField = "StateNo"; this.ddlStateNo.DataTextField = "StateName"; this.ddlStateNo.DataSource = dtStateNo; this.ddlStateNo.DataBind(); }
public string transSRMTaskAisle(string wcsProductObject) { BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = Util.JsonHelper.Json2Dtb(wcsProductObject); string json; if (dt.Rows.Count == 0) { return(json = "[{\"id\":" + dt.Rows[0]["id"] + ",\"returnCode\":001" + ",\"message\":\"失败\"" + ",\"finishDate\":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "}]"); } bll.BatchInsertTable(dt, "WCS_AisleTemp"); string Aisle = ""; string AreaCode = "002"; //获取有空货位的货架 //select ShelfCode,COUNT(*) from CMD_Cell where PalletBarCode='' and AreaCode='001' //group by ShelfCode //order by ShelfCode DataTable dtSelectAisle = bll.FillDataTable("Cmd.SelectDevice", new DataParameter("{0}", AreaCode)); if (dtSelectAisle.Rows.Count != 0) { Aisle = dtSelectAisle.Rows[0]["AisleNo"].ToString(); } else { DataTable AisleDt = bll.FillDataTable("Wcs.SelectTestAisle", new DataParameter("@AreaCode", AreaCode)); Aisle = AisleDt.Rows[0]["AisleNo"].ToString(); } json = "[{\"id\":" + dt.Rows[0]["id"] + "\"taskNo\":" + dt.Rows[0]["taskNo"] + "\"aisleNo\":" + Aisle.ToString() + "\"finishDate\":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "}]"; return(json); }
public override void Initialize(Context context) { try { dtCrane = bll.FillDataTable("WCS.SelectWCSCRANE"); //获取堆垛机信息 for (int i = 1; i <= dtCrane.Rows.Count; i++) { if (!dicCranStatus.ContainsKey(i)) { dicCranStatus.Add(i, 0); } } dtCraneErr = bll.FillDataTable("WCS.SelectCraneWarning"); tmWorkTimer.Interval = 2000; tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker); base.Initialize(context); } catch (Exception ex) { Logger.Error("CraneProcess中Initialize初始化出错,原因:" + ex.Message); } }
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 { } }
private void tmUpErpWorker(object sender, System.Timers.ElapsedEventArgs e) { lock (this) { try { tmUpErpWorkTimer.Stop(); App.Dispatching.Process.Report report = new Dispatching.Process.Report(); DataParameter[] para = new DataParameter[] { new DataParameter("{0}", string.Format("WCS_TASK.State in (7,9) and WCS_TASK.FinishReturnCode!='000' and WCS_TASK.WarehouseCode='{0}'", Program.WarehouseCode)) }; DataTable dt = bll.FillDataTable("WCS.SelectTask", para); for (int i = 0; i < dt.Rows.Count; i++) { string TaskNo = dt.Rows[i]["TaskNo"].ToString(); int Flag = 3; if (dt.Rows[i]["State"].ToString() == "9") { Flag = 5; } report.Send2MJWcs(context, Flag, TaskNo); Logger.Info("WCS重新上传任务完成标志,任务号:" + TaskNo); } } catch (Exception ex) { Logger.Error(ex.Message); } finally { tmUpErpWorkTimer.Start(); } } }
private void btnRequest_Click(object sender, EventArgs e) { if (this.txtPalletCode.Text == "") { Logger.Info("料箱号为空,请读取RFID资料!"); return; } if (!chk1.Checked) { if (this.txtProductName.Text == "") { Logger.Info("非空箱,请输入产品资料!"); this.txtProductCode.Focus(); return; } if (this.txtQty.Text.Trim() == "0" || this.txtQty.Text.Trim() == "") { Logger.Info("非空箱,请输入产品数量!"); this.txtQty.Focus(); return; } } //判断是否已经产生入库任务 int count = bll.GetRowCount("WCS_Task", string.Format("State not in ('7','9') and TaskType='11' and PalletCode='{0}'", this.txtPalletCode.Text)); if (count > 0) { Logger.Info("该料箱已经产生入库任务,不能再产生入库任务!"); return; } try { DataParameter[] parameter = new DataParameter[] { new DataParameter("{0}", string.Format("WCS_Task.State=8 and WCS_Task.TaskType='14' and WCS_Task.PalletCode='{0}'", this.txtPalletCode.Text)) }; DataTable dt = bll.FillDataTable("WCS.SelectTask", parameter); if (dt.Rows.Count == 0) { DataParameter[] paras = new DataParameter[] { new DataParameter("@PalletCode", this.txtPalletCode.Text), new DataParameter("@ProductCode", this.txtProductCode.Text), new DataParameter("@Qty", this.txtQty.Text), new DataParameter("@UserName", Program.CurrentUser) }; dt = bll.FillDataTable("WMS.Sp_CreateInStockTask", paras); } if (dt.Rows.Count > 0) { Context.ProcessDispatcher.WriteToProcess("InStockToStationProcess", "TaskNo", dt.Rows[0]["TaskNo"].ToString()); } this.txtBarcode.Text = ""; this.txtPalletCode.Text = ""; this.txtProductCode.Text = ""; this.txtProductName.Text = ""; this.txtQty.Text = "0"; } catch (Exception ex) { Logger.Error("扫码入库中入库请求出现异常,错误:" + ex.Message); } }
private void BindData() { string filter = "CMD_Cell.ProductCode!='' and CMD_Cell.InDate is not null"; DataTable dt = bll.FillDataTable("WCS.SelectStockTotal", new DataParameter[] { new DataParameter("{0}", filter) }); bsMain.DataSource = dt; }
private void frmMonitor_Load(object sender, EventArgs e) { AddDicKeyValue(); try { dtCraneError = bll.FillDataTable("WCS.SelectCraneWarning"); for (int i = 1; i <= 5; i++) { Control[] ctl = this.Controls.Find("picCrane" + i.ToString(), true); if (ctl.Length > 0) { ((PictureBox)ctl[0]).Parent = pictureBox1; ((PictureBox)ctl[0]).BackColor = Color.Transparent; } } for (int i = 101; i <= 120; i++) { Control[] ctl = this.Controls.Find("picCar" + i.ToString(), true); if (ctl.Length > 0) { ((PictureBox)ctl[0]).Visible = false; ((PictureBox)ctl[0]).Parent = pictureBox1; ((PictureBox)ctl[0]).BackColor = Color.Transparent; } } PLCS.OnPLC += new PLCEventHandler(Monitor_OnPLC); Cranes.OnCrane += new CraneEventHandler(Monitor_OnCrane); ServerInfo[] Servers = new MonitorConfig("Monitor.xml").Servers; for (int i = 0; i < Servers.Length; i++) { OPCServer opcServer = new OPCServer(Servers[i].Name); opcServer.Connect(Servers[i].ProgID, Servers[i].ServerName);// opcServer.Connect(config.ConnectionString); OPCGroup group = opcServer.AddGroup(Servers[i].GroupName, Servers[i].UpdateRate); foreach (ItemInfo item in Servers[i].Items) { group.AddItem(item.ItemName, item.OpcItemName, item.ClientHandler, item.IsActive); } if (Servers[i].Name == "CarServer") { opcServer.Groups.DefaultGroup.OnDataChanged += new OPCGroup.DataChangedEventHandler(CarServer_OnDataChanged); } else { opcServer.Groups.DefaultGroup.OnDataChanged += new OPCGroup.DataChangedEventHandler(CraneServer_OnDataChanged); } } tmCrane.Interval = 2000; tmCrane.Elapsed += new System.Timers.ElapsedEventHandler(tmCraneWorker); tmCrane.Start(); } catch (Exception ex) { Logger.Error("监控界面中frmMonitor_Load出现异常" + ex.Message); } }
private void CellOpDialog_Load(object sender, EventArgs e) { DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "Flag=1") }); DataRow drNew = dtBillType.NewRow(); drNew["BillTypeCode"] = ""; drNew["BillTypeName"] = "请选择"; dtBillType.Rows.InsertAt(drNew, 0); CellCode = dr["CellCode"].ToString(); AreaCode = dr["AreaCode"].ToString(); this.txtCellCode.Text = CellCode; this.txtBillNo.Text = dr["BillNo"].ToString(); this.txtProductCode.Text = dr["PalletBarCode"].ToString(); this.checkBox1.Checked = dr["IsLock"].ToString() == "1"; this.checkBox2.Checked = dr["IsActive"].ToString() == "0"; this.checkBox3.Checked = dr["ErrorFlag"].ToString() == "1"; if (dr["InDate"].ToString() == "") { this.dtpInDate.Checked = false; } else { this.dtpInDate.Checked = true; this.dtpInDate.Value = DateTime.Parse(dr["InDate"].ToString()); } this.groupBox2.Enabled = false; BillFields.Add("BillID", "单据号码"); BillFields.Add("BillDate", "单据日期"); BillFields.Add("BillTypeCode", "类型编号"); BillFields.Add("BillTypeName", "单据类型"); BillFields.Add("AreaCode", "库区编号"); BillFields.Add("AreaName", "库区名称"); BillFields.Add("Memo", "备注"); BillFields.Add("Tasker", "作业人员"); BillFields.Add("TaskDate", "作业日期"); ProductFields.Add("ProductCode", "产品编号"); ProductFields.Add("ProductName", "产品名称"); ProductFields.Add("ProductNo", "ERP物料编号"); ProductFields.Add("Spec", "规格"); TaskFields.Add("BillID", "单据号码"); TaskFields.Add("TaskNo", "任务编号"); TaskFields.Add("BillTypeName", "任务类型"); TaskFields.Add("ProductCode", "产品编号"); TaskFields.Add("ProductName", "产品名称"); TaskFields.Add("ProductTypeName", "产品类型"); TaskFields.Add("CraneNo", "堆垛机"); TaskFields.Add("StartDate", "起始时间"); TaskFields.Add("FinishDate", "结束时间"); this.groupBox2.Enabled = !radioButton1.Checked; this.groupBox3.Enabled = !radioButton1.Checked; }
public override void Initialize(Context context) { try { dtCraneErr = bll.FillDataTable("WCS.SelectCraneError"); AreaCode = BLL.Server.GetAreaCode(); //获取堆垛机信息 DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "1=1") }); for (int i = 0; i < dt.Rows.Count; i++) { if (!dCrnStatus.ContainsKey(i)) { rCrnStatus crnsta = new rCrnStatus(); dCrnStatus.Add(i, crnsta); dCrnStatus[i].TaskNo = ""; dCrnStatus[i].Status = int.Parse(dt.Rows[i]["State"].ToString()); dCrnStatus[i].TaskStatus = 0; dCrnStatus[i].ErrCode = 0; dCrnStatus[i].Action = 0; } } tmWorkTimer.Interval = 2001; tmWorkTimer.Elapsed += new ElapsedEventHandler(tmWorker); base.Initialize(context); } catch (Exception ex) { Logger.Error("CraneProcess堆垛机初始化出错,原因:" + ex.Message); } }
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 ProductCode not in ('0001','0002') and ProductCode!=''"); 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.SelectProductType", new DataParameter[] { new DataParameter("{0}", string.Format("ProductTypeCode='{0}'", strID)) }); BindData(dt); writeJsvar(FormID, SqlCmd, strID); } }
private void frmInStockTask_Load(object sender, EventArgs e) { AreaCode = BLL.Server.GetAreaCode(); DataTable dt = bll.FillDataTable("WCS.SelectStationNo"); this.cmbStationNo.DataSource = dt.DefaultView; this.cmbStationNo.ValueMember = "StationNo"; this.cmbStationNo.DisplayMember = "StationNo"; }
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); } } } } }
public override void Initialize(Context context) { try { dtDeviceAlarm = bll.FillDataTable("WCS.SelectDeviceAlarm", new DataParameter[] { new DataParameter("{0}", "Flag=2") }); base.Initialize(context); } catch (Exception ex) { Logger.Error("ElevatorAlarmProcess提升机初始化出错,原因:" + ex.Message); } }
private void frmScan_Load(object sender, EventArgs e) { DataRow dr = dtTask.Rows[0]; PalletCode = dr["PalletCode"].ToString(); this.txtPalletCode.Text = dr["PalletCode"].ToString(); this.txtTaskNo.Text = dr["TaskNo"].ToString(); this.txtCellCode.Text = dr["CellCode"].ToString(); dtPallet = bll.FillDataTable("WCS.SelectTaskDetail", new DataParameter[] { new DataParameter("{0}", string.Format("T.TaskNo='{0}'", this.txtTaskNo.Text)) }); this.bsMain.DataSource = dtPallet; }
private void BindDropDown() { DataTable dt = bll.FillDataTable("CMD.SelectProductCategory"); DataRow dr = dt.NewRow(); dr["CategoryCode"] = ""; dr["CategoryCode"] = "请选择"; dt.Rows.InsertAt(dr, 0); dt.AcceptChanges(); this.cmbCategoryCode.DisplayMember = "CategoryCode"; this.cmbCategoryCode.ValueMember = "CategoryCode"; this.cmbCategoryCode.DataSource = dt; }
private void frmScan_Load(object sender, EventArgs e) { DataRow dr = dtTask.Rows[0]; this.txtBillID.Text = dr["BillID"].ToString(); PalletCode = dr["PalletCode"].ToString(); this.txtPalletCode.Text = dr["PalletCode"].ToString(); this.txtTaskNo.Text = dr["TaskNo"].ToString(); this.txtCellCode.Text = dr["CellCode"].ToString(); dtPallet = bll.FillDataTable("WCS.SelectCheckPalletDetail", new DataParameter[] { new DataParameter("@PalletCode", this.txtPalletCode.Text) }); this.bsMain.DataSource = dtPallet; blnOk = false; }
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 frmChangeMode_Load(object sender, EventArgs e) { dicProductNo.Add(0, "A"); dicProductNo.Add(1, "B"); dicProductNo.Add(2, "C"); dicProductNo.Add(3, "D"); dicProductNo.Add(4, "E"); dicProductNo.Add(5, "F"); ProductFields.Add("ProductNo", "产品代号"); ProductFields.Add("ProductCode", "产品编号"); ProductFields.Add("ProductName", "产品名称"); ProductFields.Add("Spec", "规格"); DataTable dt = bll.FillDataTable("WCS.SelectWorkMode", new DataParameter[] { new DataParameter("{0}", "1=1") }); if (dt.Rows.Count > 0) { if (dt.Rows[0]["WorkMode"].ToString() == "0") { this.radioButton1.Checked = true; } else if (dt.Rows[0]["WorkMode"].ToString() == "1") { this.radioButton2.Checked = true; } else if (dt.Rows[0]["WorkMode"].ToString() == "2") { this.radioButton3.Checked = true; } else if (dt.Rows[0]["WorkMode"].ToString() == "3") { this.radioButton4.Checked = true; } if (this.radioButton3.Checked || this.radioButton4.Checked) { this.txtProductCode.Text = dt.Rows[0]["ProductCode"].ToString(); this.txtProductName.Text = dt.Rows[0]["ProductName"].ToString(); this.txtQuantity.Text = dt.Rows[0]["OutQty"].ToString(); } else { this.txtProductCode.Text = ""; this.txtProductName.Text = ""; this.txtQuantity.Text = ""; } } }
private void frmCraneTask_Load(object sender, EventArgs e) { DataTable dt = bll.FillDataTable("CMD.SelectCrane", new DataParameter[] { new DataParameter("{0}", "CMD_Crane.State='1'") }); this.cmbCraneNo.DataSource = dt.DefaultView; this.cmbCraneNo.ValueMember = "CraneNo"; this.cmbCraneNo.DisplayMember = "CraneNo"; this.cmbTaskType.SelectedIndex = 0; this.txtTaskNo1.Text = "0000000001"; }
private void btnRefresh_Click(object sender, EventArgs e) { try { if (bsMain.Filter.Trim().Length != 0) { DialogResult result = MessageBox.Show("重新读入数据请选择'是(Y)',清除过滤条件请选择'否(N)'", "询问", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); switch (result) { case DialogResult.No: DataGridViewAutoFilter.DataGridViewAutoFilterTextBoxColumn.RemoveFilter(dgvMain); return; case DialogResult.Cancel: return; } } ShelfCode.Clear(); ShelfName.Clear(); DataTable dtShelf = bll.FillDataTable("CMD.SelectShelf"); for (int i = 1; i <= dtShelf.Rows.Count; i++) { ShelfCode.Add(2 * i - 1, dtShelf.Rows[i - 1]["ShelfCode"].ToString()); ShelfCode.Add(2 * i, dtShelf.Rows[i - 1]["ShelfCode"].ToString()); ShelfName.Add(2 * i - 1, dtShelf.Rows[i - 1]["ShelfValue"].ToString()); ShelfName.Add(2 * i, dtShelf.Rows[i - 1]["ShelfValue"].ToString()); } btnRefresh.Enabled = false; btnChart.Enabled = false; pnlProgress.Top = (pnlMain.Height - pnlProgress.Height) / 3; pnlProgress.Left = (pnlMain.Width - pnlProgress.Width) / 2; pnlProgress.Visible = true; Application.DoEvents(); cellTable = bll.FillDataTable("WCS.SelectCell"); bsMain.DataSource = cellTable; pnlProgress.Visible = false; btnRefresh.Enabled = true; btnChart.Enabled = true; } catch (Exception exp) { MessageBox.Show("读入数据失败,原因:" + exp.Message); } }
private void frmInStockTask_Load(object sender, EventArgs e) { DataTable dt = bll.FillDataTable("CMD.SelectArea"); this.cmbAreaCode.DataSource = dt.DefaultView; this.cmbAreaCode.ValueMember = "AreaCode"; this.cmbAreaCode.DisplayMember = "AreaName"; }
private void txtCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (this.txtCode.Text.Trim().Length == 0) { return; } CheckCount++; bll.ExecNonQuery("WCS.updateCheckScanDetail", new DataParameter[] { new DataParameter("@BarCode", this.txtCode.Text.Trim()), new DataParameter("@TaskNo", TaskNo), new DataParameter("@BillID", BillID) }); DataTable dt = bll.FillDataTable("WCS.SelectCheckScanDetail", new DataParameter[] { new DataParameter("@TaskNo", TaskNo) }); this.bsCheck.DataSource = dt; } }
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) }); Session[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; }
protected void Page_Load(object sender, EventArgs e) { string strID = Request.QueryString["Where"] + ""; BLL.BLLBase bll=new BLL.BLLBase(); DataTable dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", strID) }); if (dtCell.Rows.Count > 0) { DataRow dr=dtCell.Rows[0]; lblProductName.Text =dr["ProductName"].ToString(); lblBarcode.Text = dr["PalletBarcode"].ToString(); lblPalletCode.Text = dr["PalletCode"].ToString(); lblBillNo.Text = dr["BillNo"].ToString(); lblIndate.Text = ToYMDHM(dr["InDate"]); lblAreaName.Text = dr["AreaName"].ToString(); lblShelfName.Text = dr["ShelfName"].ToString(); lblCellColumn.Text = dr["CellColumn"].ToString(); lblCellRow.Text = dr["CellRow"].ToString(); if (dr["IsLock"].ToString() == "0") lblState.Text = "正常"; else lblState.Text = "锁定"; if (dr["ErrorFlag"].ToString() == "1") lblState.Text = "异常"; } }
private void frmProductEdit_Shown(object sender, EventArgs e) { DataTable dtCategoryCode = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", "1=1") }); this.cmbCategoryCode.DisplayMember = "CategoryName"; this.cmbCategoryCode.ValueMember = "CategoryCode"; this.cmbCategoryCode.DataSource = dtCategoryCode; if (State == "add") { txtProductCode.Text = bll.GetNewID("CMD_Product", "ProductCode", "1=1"); this.txtSafeQty.Text = "0"; this.txtCreator.Text = App.Program.CurrentUser; this.txtCreateDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); this.txtUpdater.Text = Program.CurrentUser; this.txtUpdateDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } else { this.txtProductCode.ReadOnly = true; this.txtProductCode.Text = drEdit["ProductCode"].ToString(); this.txtProductName.Text = drEdit["ProductName"].ToString(); this.cmbCategoryCode.SelectedValue = drEdit["CategoryCode"].ToString(); this.txtUnit.Text = drEdit["Unit"].ToString(); this.txtSpec.Text = drEdit["Spec"].ToString(); this.txtSafeQty.Text = drEdit["SafeQty"].ToString(); this.txtDescription.Text = drEdit["Description"].ToString(); this.txtMemo.Text = drEdit["Memo"].ToString(); this.txtCreator.Text = drEdit["Creator"].ToString(); this.txtCreateDate.Text = drEdit["CreateDate"].ToString(); this.txtUpdater.Text = App.Program.CurrentUser; this.txtUpdateDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } txtProductName.Focus(); }
protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher) { try { Dictionary<string, string> msg = (Dictionary<string, string>)stateItem.State; object o = WriteToService("StockPLC", "PLCFree"); switch (stateItem.ItemName) { case "ARQ": //入库申请 if (o.ToString() == "1") { //入库写入 BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtTask = bll.FillDataTable("WCS.SelectTask", new DataParameter[] { new DataParameter("@TaskNo", msg["TaskNo"]) }); int TaskType = int.Parse(dtTask.Rows[0]["TaskType"].ToString()); string TaskNo = msg["TaskNo"]; string CellCode = dtTask.Rows[0]["CellCode"].ToString(); //写入任务号 WriteToService("StockPLC", "TaskNo1", int.Parse(TaskNo.Substring(0, 4))); WriteToService("StockPLC", "TaskNo2", int.Parse(TaskNo.Substring(4, 4))); WriteToService("StockPLC", "TaskNo3", int.Parse(TaskNo.Substring(8))); //写入起始位,结束位 if (TaskType == 3) { WriteToService("StockPLC", "FromStation1", 0); WriteToService("StockPLC", "FromStation2", 0); WriteToService("StockPLC", "FromStation3", 0); } else { WriteToService("StockPLC", "FromStation1", int.Parse(CellCode.Substring(0, 3))); WriteToService("StockPLC", "FromStation2", int.Parse(CellCode.Substring(0, 3))); WriteToService("StockPLC", "FromStation3", 68); } WriteToService("StockPLC", "ToStation1", int.Parse(CellCode.Substring(0, 3))); WriteToService("StockPLC", "ToStation2", int.Parse(CellCode.Substring(3, 3))); WriteToService("StockPLC", "ToStation3", int.Parse(CellCode.Substring(6))); //写入标识 WriteToService("StockPLC", "WriteFinished", 1); WriteToService("PDATcp", "msg", "1"); } else { WriteToService("PDATcp", "msg", "0"); } break; } } catch (Exception ex) { } }
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)) }); Session[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) { DataTable dt = null; try { BLL.BLLBase bll = new BLL.BLLBase(); dt = bll.FillDataTable("Security.SelectSoftWareInfo", null); } catch (Exception exp) { Session["ModuleName"] = "关于模块"; Session["FunctionName"] = "Page_Load"; Session["ExceptionalType"] = exp.GetType().FullName; Session["ExceptionalDescription"] = exp.Message; Response.Redirect("MistakesPage.aspx"); } LabVersion.Font.Size = FontUnit.Smaller; labCompany.Font.Size = FontUnit.Smaller; labCopyrigth.Font.Size = FontUnit.Smaller; labCompanyTelephone.Font.Size = FontUnit.Smaller; labCompanyFax.Font.Size = FontUnit.Smaller; labCompanyAddress.Font.Size = FontUnit.Smaller; labCompanyWeb.Font.Size = FontUnit.Smaller; lbtnCompanyWeb.Font.Size = FontUnit.Smaller; lbtnQuit.Font.Size = FontUnit.Smaller; if (dt.Rows.Count > 0) { // LabSoftWareName.Text = dt.Rows[0][0].ToString(); //LabSoftWareName.Font.Size = FontUnit.Smaller; LabVersion.Text = "软件版本:" + dt.Rows[0]["Version"].ToString(); LabVersion.Font.Size = FontUnit.Smaller; this.lblSoftwareName.Text = "软件名称:" + dt.Rows[0]["SoftwareName"].ToString(); this.lblSoftwareName.Font.Size = FontUnit.Smaller; labCompany.Text = "公司名称:" + dt.Rows[0]["Company"].ToString(); labCompany.Font.Size = FontUnit.Smaller; labCopyrigth.Text = dt.Rows[0]["Copyrigth"].ToString(); labCopyrigth.Font.Size = FontUnit.Smaller; labCompanyTelephone.Text = "公司电话:" + dt.Rows[0]["CompanyTelephone"].ToString(); labCompanyTelephone.Font.Size = FontUnit.Smaller; labCompanyFax.Text = "公司传真:" + dt.Rows[0]["CompanyFax"].ToString(); labCompanyFax.Font.Size = FontUnit.Smaller; labCompanyAddress.Text = "公司地址:" + dt.Rows[0]["CompanyAddress"].ToString(); labCompanyAddress.Font.Size = FontUnit.Smaller; labCompanyWeb.Text = "公司网址:"; labCompanyWeb.Font.Size = FontUnit.Smaller; lbtnCompanyWeb.Text = dt.Rows[0]["CompanyWeb"].ToString(); lbtnCompanyWeb.Font.Size = FontUnit.Smaller; } }
protected void ddlAreaCode_SelectedIndexChanged(object sender, EventArgs e) { string AreaCode = ddlArea.SelectedValue; BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='" + AreaCode + "' and ProductTypeCode<>'0001'") }); DataRow dr = ProductType.NewRow(); dr["ProductTypeCode"] = ""; dr["ProductTypeName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "ProductTypeCode"; this.ddlProductType.DataTextField = "ProductTypeName"; this.ddlProductType.DataSource = ProductType; this.ddlProductType.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { rptview.Visible = false; BLL.BLLBase bll = new BLL.BLLBase(); DataTable dtArea = bll.FillDataTable("CMD.SelectAreaSation", null); DataRow dr = dtArea.NewRow(); dr[0] = "请选择"; dtArea.Rows.InsertAt(dr, 0); dtArea.AcceptChanges(); this.ddlAreaSation.DataValueField = "areasation"; this.ddlAreaSation.DataTextField = "areasation"; this.ddlAreaSation.DataSource = dtArea; this.ddlAreaSation.DataBind(); } else { string hdnwh = HdnWH.Value; int W = int.Parse(hdnwh.Split('#')[0]); int H = int.Parse(hdnwh.Split('#')[1]); WebReport1.Width = W - 60; WebReport1.Height = H - 100; if (this.HdnProduct.Value.Length > 0) this.btnProduct.Text = "取消指定"; else this.btnProduct.Text = "指定"; if (this.hdnColor.Value.Length > 0) this.btnColor.Text = "取消指定"; else this.btnColor.Text = "指定"; if (this.hdnFact.Value.Length > 0) this.btnFact.Text = "取消指定"; else this.btnFact.Text = "指定"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "BindEvent();", true); } SetTextReadOnly(this.txtColor, this.txtProductModule, this.txtFact); }
private bool LoadRpt() { try { GetStrWhere(); string frx = "TaskQuery.frx"; string Comds = "WMS.SelectTaskQuery"; 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, "TaskQuery"); } catch (Exception ex) { } return true; }
protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher) { try { object obj = ObjectUtil.GetObject(stateItem.State); if (obj == null) return; if (obj.ToString() == "48" || obj.ToString() == "0") return; string carNo = stateItem.ItemName.Substring(0, 2); Logger.Info("小车" + carNo + "接到入库确认请求"); string CraneNo = "01"; if (carNo == "02") CraneNo = "02"; BLL.BLLBase bll = new BLL.BLLBase(); //判断堆垛机状态是否可用 //查找有无请求状态(state='1')的任务,如没有则认为是空托盘回库 string filter = string.Format("WCS_Task.State='1' and WCS_TASK.TaskType='11' and WCS_TASK.CarNo='{0}'", carNo); DataParameter[] parameter = new DataParameter[] { new DataParameter("{0}", filter) }; DataTable dt = bll.FillDataTable("WCS.SelectTask", parameter); int rows = 0; if (dt.Rows.Count > 0) { rows = bll.ExecNonQuery("WCS.UpdateTaskState", new DataParameter[] { new DataParameter("@State", 2), new DataParameter("@CarNo", carNo) }); WriteToService("CarPLC", carNo + "_CarReply", 49); Logger.Info("小车:" + carNo + "收到入库请求,更新任务状态,影响行数" + rows); } else { //判断有无正在执行的任务,如有不做处理,如没有则产生一笔空盘回库任务 filter = string.Format("WCS_Task.State='3' and WCS_TASK.TaskType='11' and WCS_TASK.CarNo='{0}'", carNo); parameter = new DataParameter[] { new DataParameter("{0}", filter) }; DataTable dting = bll.FillDataTable("WCS.SelectTask", parameter); if (dting.Rows.Count > 0) { WriteToService("CarPLC", carNo + "_CarReply", 50); return; } //有无盘点回库任务 filter = string.Format("WCS_Task.State='4' and WCS_TASK.TaskType='14' and WCS_TASK.CarNo='{0}'", carNo); parameter = new DataParameter[] { new DataParameter("{0}", filter) }; dting = bll.FillDataTable("WCS.SelectTask", parameter); if (dting.Rows.Count > 0) { //盘点任务改变状态为5,堆垛机调度回库 string TaskNo = dting.Rows[0]["TaskNo"].ToString(); bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 5), new DataParameter("@TaskNo", TaskNo) }); WriteToService("CarPLC", carNo + "_CarReply", 49); return; } //查找锁定货位,且产品是托盘的货位,如有判断为实托盘出库后,托盘回库 string ProductCode = "00" + CraneNo; parameter = new DataParameter[] { new DataParameter("{0}", string.Format("CMD_Cell.ProductCode='{0}' and CMD_Cell.IsActive='1' and CMD_Cell.IsLock='1' and CMD_Cell.ErrorFlag!='1'",ProductCode)), new DataParameter("{1}", carNo) }; dt = bll.FillDataTable("CMD.SelectCellByCar", parameter); if (dt.Rows.Count > 0) { //产生一笔空托盘入库任务 //锁定货位 parameter = new DataParameter[] { new DataParameter("@CarNo", carNo), new DataParameter("@CraneNo", CraneNo), new DataParameter("@CellCode", dt.Rows[0]["CellCode"].ToString()) }; bll.ExecNonQueryTran("WCS.Sp_RequestPalletInTask", parameter); WriteToService("CarPLC", carNo + "_CarReply", 49); Logger.Info("小车:" + carNo + "接到入库请求,产生一笔托盘回库任务"); } } WriteToService("CarPLC", carNo + "_CarReply", 50); } catch (Exception e) { Logger.Error("Dispatching.Process.CarProcess:" + e.Message); } }
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; } } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["G_User"] != null) { int iGroupID = int.Parse(Session["GroupID"].ToString()); BLL.BLLBase bll = new BLL.BLLBase(); DataTable dt = bll.FillDataTable("Security.SelectGroupRole", new DataParameter[] { new DataParameter("@GroupID", iGroupID), new DataParameter("@SystemName", "WMS") }); string preModuleName = ""; string preSubModuleName = ""; Table tbModule = null; Panel pSubModule = null; int index = 0; foreach (DataRow dr in dt.Rows) { string currentModuleName = dr["MenuParent"].ToString(); string currentSubModuleName = dr["MenuTitle"].ToString(); string url = dr["MenuUrl"].ToString(); string image = dr["MenuImage"].ToString(); string ParentImage = dr["ParentImage"].ToString(); string ModuleID = dr["MenuCode"].ToString(); if (preModuleName != currentModuleName) { preModuleName = currentModuleName; preSubModuleName = currentSubModuleName; string parentCode = dr["MenuCode"].ToString().Substring(0, 8); tbModule = this.CreateModuleTable(preModuleName, ParentImage); tbModule.ID = "table" + index.ToString(); this.plMenu.Controls.Add(tbModule); pSubModule = new Panel(); // pSubModule.Height = 50; pSubModule.ID = "div" + index.ToString(); pSubModule.Attributes.Add("style", "display:none;"); tbModule.Attributes.Add("onclick", "Display('" + index.ToString() + "');"); this.plMenu.Controls.Add(pSubModule); pSubModule.Controls.Add(CreateSubModuleTable(preModuleName, preSubModuleName, url, image, "tab_" + ModuleID)); } else { if (preSubModuleName != currentSubModuleName) { preSubModuleName = currentSubModuleName; pSubModule.Controls.Add(CreateSubModuleTable(preModuleName, preSubModuleName, url, image, "tab_" + ModuleID)); } } index++; } tbModule = CreateModuleTable("退出系统", ""); tbModule.ID = "table" + index.ToString(); pSubModule = new Panel(); this.plMenu.Controls.Add(tbModule); pSubModule = new Panel(); pSubModule.ID = "div" + index.ToString(); pSubModule.Attributes.Add("style", "display:none;"); pSubModule.Controls.Add(CreateLogoutTable()); tbModule.Attributes.Add("onclick", "Display('" + index.ToString() + "');"); this.plMenu.Controls.Add(pSubModule); //操作权限保存Sesion中(ModuleID,OperatorCode,MenuCode) Session["DT_UserOperation"] = dt; } else { } } catch (Exception exp) { } }
private void GetDestopItemByUserID(string UserID) { BLL.BLLBase bll = new BLL.BLLBase(); dtDestopItem = bll.FillDataTable("Security.SelectUserQuickDesktop", new DataParameter[] { new DataParameter("@UserID", UserID) }); iTableCount = dtDestopItem.Rows.Count; }
private void BindOther() { BLL.BLLBase bll = new BLL.BLLBase(); DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='001' and ProductTypeCode<>'0001'") }); DataRow dr = ProductType.NewRow(); dr["ProductTypeCode"] = ""; dr["ProductTypeName"] = "请选择"; ProductType.Rows.InsertAt(dr, 0); ProductType.AcceptChanges(); this.ddlProductType.DataValueField = "ProductTypeCode"; this.ddlProductType.DataTextField = "ProductTypeName"; 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 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 = JsonHelper.Dtb2Json(dtCell); rr.data = str; rr.type = "" + dtCell.GetType(); } catch (Exception ex) { } return rr; }
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(); 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 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 = int.Parse(ShelfCell.Rows[0]["Columns"].ToString()); string Width = "15%"; if (Columns > 6) Width = "8%"; 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 = Columns; j >= 1; j--) { int k = j; if (shelfCode == "001002" || shelfCode == "001004") //特殊处理 { k = j + 1; } if (shelfCode == "001005") { k = 12 - j; } if (shelfCode == "001006") { k = 13 - j; } if (AreaCode == "") strWhere = string.Format("CellRow={0} and CellColumn={1}", i, k); else strWhere = string.Format("CellRow={0} and CellColumn={1} and AreaCode='{2}'", i, k, 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 == 1) { if (shelfCode == "001002" || shelfCode == "001005" || shelfCode == "001004") { 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 = Columns; j >= 1; j--) { int k = j; if (shelfCode == "001002" || shelfCode == "001004") //特殊处理 { k = j + 1; } if (shelfCode == "001005") { k = 12 - j; } if (shelfCode == "001006") { k = 13 - j; } 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.ToString()+"</font>"; rowNum.Cells.Add(cellNum); } tb.Rows.Add(rowNum); } } return tb; }
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 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; }