using DevComponents.DotNetBar.Layout; using DevComponents.DotNetBar.SuperGrid; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using WCS_Client.UC; using WCS_Client.Utility; using WCS_Client.Workflow; namespace WCS_Client.Frm { public partial class FrmAGVSet : Form { public FrmAGVSet() { InitializeComponent(); InitFrm(); } private void InitFrm() { List GCList = new List() { SuperGridUtil.Get_GridColumn("WORKSHOP", "车间", 120), SuperGridUtil.Get_GridColumn("POSITION", "产线", 120), SuperGridUtil.Get_CheckBoxX_GridColumn("INENABLE", "入库启用", 100), SuperGridUtil.Get_CheckBoxX_GridColumn("OUTENABLE", "出库启用", 120), }; List LCIList = new List(); LCIList.Add(LCItemUtil.Add_TextboxX("WORKSHOP", "车间:", 20, SubmitMethods, null)); LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "WORKSHOP like '%{0}%'" }; LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods)); LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods)); if (CurrentHelper.User.Use_RoleId == 1) { LCIList.Add(LCItemUtil.Add_Button("btn_InEnable", "入库启用", 80, 30, DevComponents.DotNetBar.eButtonColor.BlueWithBackground, SubmitMethods)); LCIList.Add(LCItemUtil.Add_Button("btn_OutEnable", "出库启用", 80, 30, DevComponents.DotNetBar.eButtonColor.BlueWithBackground, SubmitMethods)); LCIList.Add(LCItemUtil.Add_Button("btn_InStop", "入库停用", 80, 30, DevComponents.DotNetBar.eButtonColor.MagentaWithBackground, SubmitMethods)); LCIList.Add(LCItemUtil.Add_Button("btn_OutStop", "出库停用", 80, 30, DevComponents.DotNetBar.eButtonColor.MagentaWithBackground, SubmitMethods)); } uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethods, RefreshRoleMethods, DoubleClikMethod, null, null); uC_QueryPage1.ClearLCItemValue(); CommonShow.ShowProcessing("正在处理中,请稍候...", this, (obj) => { uC_QueryPage1.RefreshData(1, 0); }, null); } private PageData QueryPageDataMethods(int PageIndex, int PageSize) { string _SQLText = @"SELECT * FROM [WCS_OPP].[dbo].[WCS_AGV_Config] where 1=1 "; string _Orderby = "WORKSHOP asc"; PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, PageSize); return pd; } private void RefreshRoleMethods(bool ChkValue) { } private void DoubleClikMethod(DataRow dr) { //wcs_task_no = Convert.ToInt32(dr["TASK_NO"].ToString()); //FrmWCS_TaskDIS_DTL Frm = new FrmWCS_TaskDIS_DTL(wcs_task_no); //Frm.Show(); } private void SubmitMethods(string LCName) { if (LCName == "btn_QDB") { uC_QueryPage1.RefreshData(); } else if (LCName == "btn_QClear") { uC_QueryPage1.ShowOpaqueLayer(); uC_QueryPage1.ClearLCItemValue(); uC_QueryPage1.RefreshData(1, 0); uC_QueryPage1.HideOpaqueLayer(); } else if (LCName == "btn_InEnable") { DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows(); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowTips("请选择配置信息。"); return; } string proLine = dt.Rows[0]["POSITION"].ToString(); int convNo1 = (int)dt.Rows[0]["ID"]; var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要启用入库功能吗?", proLine)); if (result == DialogResult.Yes) { string msg = SystemConfigWorkflow.AgvSet(proLine, true, LCName); MessageUtil.ShowTips(msg); uC_QueryPage1.RefreshData(1, 0); } } else if (LCName == "btn_InStop") { DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows(); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowTips("请选择配置信息。"); return; } //int convNo = (int)dt.Rows[0]["WORKSHOP"]; string proLine = dt.Rows[0]["POSITION"].ToString(); var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要禁用入库功能吗?", proLine)); if (result == DialogResult.Yes) { string msg = SystemConfigWorkflow.AgvSet(proLine, false, LCName); MessageUtil.ShowTips(msg); uC_QueryPage1.RefreshData(1, 0); } } else if (LCName == "btn_OutEnable") { DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows(); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowTips("请选择配置信息。"); return; } //int convNo = (int)dt.Rows[0]["WORKSHOP"]; string proLine = dt.Rows[0]["POSITION"].ToString(); var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]号车间确定要启用出库功能吗?", proLine)); if (result == DialogResult.Yes) { string msg = SystemConfigWorkflow.AgvSet(proLine, true, LCName); MessageUtil.ShowTips(msg); uC_QueryPage1.RefreshData(1, 0); } } else if (LCName == "btn_OutStop") { DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows(); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowTips("请选择配置信息。"); return; } //int convNo = (int)dt.Rows[0]["WORKSHOP"]; string proLine = dt.Rows[0]["POSITION"].ToString(); var result = MessageUtil.ShowYesNoAndWarning(string.Format("[{0}]产线确定要禁用出库功能吗?", proLine)); if (result == DialogResult.Yes) { string msg = SystemConfigWorkflow.AgvSet(proLine, false, LCName); MessageUtil.ShowTips(msg); uC_QueryPage1.RefreshData(1, 0); } } } } }