lu
2024-11-29 6c4f48c41bca123db3c3aac7955b785569112542
DevApp/Gs.DevApp/DevFrm/BasicData/Frm_MesDaaDirectOut.cs
@@ -19,13 +19,11 @@
        {
            InitializeComponent();
            this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
            this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
@@ -43,6 +41,7 @@
                Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                e.Graphics.DrawString(str, f, Brushes.Gray, r);
            };
            txt_itemId.KeyFile = "id";
        }
        private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
@@ -50,17 +49,7 @@
            await Task.Delay(100);
            getPageList(1);
        }
        /// <summary>
        /// 双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
            if (!string.IsNullOrEmpty(rowGuid))
                getModel(rowGuid, false, 999);
        }
        /// <summary>
        /// 分页事件
        /// </summary>
@@ -113,7 +102,7 @@
        private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
        {
            string rowGuid = "", rowName = "";
            //  (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_userName, gridView1);
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, textEdit1, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
@@ -162,22 +151,7 @@
                getPageList(1);
            }
        }
        /// <summary>
        /// 修改事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
        {
            string rowGuid = "", rowName = "";
            // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_userName, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            getModel(rowGuid, true, 1);
        }
        /// <summary>
        /// 新增事件
        /// </summary>
@@ -198,16 +172,25 @@
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            toolBarMenu1.isSetBtn = false;
            //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
            string _workshop = txt_workshop.GetId();
            string _itemId=txt_itemId.GetId();
            if (string.IsNullOrEmpty(_workshop.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("登录账号不能为空!");
                // txt_account.Focus();
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择车间!");
                txt_workshop.Focus();
                return;
            }
            if (string.IsNullOrEmpty(_itemId.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择无聊!");
                txt_itemId.Focus();
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                Workshop= _workshop,
                ItemId= _itemId
            };
            try
            {