public void DeleteDepartmentClass(DoWorkEventArgs e)
 {
     departmentBindingSource.EndEdit();
     if (string.IsNullOrEmpty(DepCodeTextEdit.Text))
     {
         ClsMsg.ShowWarningEmptyMsg(ItemForDepCode.Text);
     }
     else
     {
         if (ClsMsg.ShowQuestionMsg("是否删除" + DepNameTextEdit.Text + "部门数据?") == DialogResult.Yes)
         {
             using (var DelClient = new SRDepartment.DepartmentServiceClient())
             {
                 Model = new SRDepartment.Department();
                 Model = departmentBindingSource.DataSource as SRDepartment.Department;
                 var ret = DelClient.DelDepartmentData(context.SessionID, Model.DepCode);
                 if (ret.IsSuccess)
                 {
                     this.AddSysOperLogs(this.Text, OperateStatus.除, strCode: Model.DepCode);
                     e.Result = true;
                     ClsMsg.ShowWarningMsg("数据删除成功!");
                 }
                 else
                 {
                     e.Result = true;
                     bgWait.ReportProgress(101, ret.Message);
                 }
             }
         }
     }
 }
Beispiel #2
0
 //添加
 private void ButAdd_Click(object sender, EventArgs e)
 {
     try
     {
         qCDrumsFindLeakReportBindingSource.EndEdit();//获取文本框数据
         if (model.FLResult.IsNullOrEmpty())
         {
             FLResultTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFLResult.Text);
         }
         else if (model.Frequency.IsNullOrEmpty())
         {
             FrequencyTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
         }
         else if (model.DevName.IsNullOrEmpty())
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForDrumsName.Text);
         }
         else if (model.FLSituation.IsNullOrEmpty())
         {
             FLSituationTextEdit.Focus();
             ClsMsg.ShowWarningEmptyMsg(ItemForFLSituation.Text);
         }
         else if (model.FLResult.Equals("合格") || ClsMsg.ShowQuestionMsg("当前检漏结果为:不合格!\r\n是否继续提交呢?") == DialogResult.Yes)
         {
             BgWait.RunWorkerAsync("SaveData");
         }
     }
     catch (Exception ex)
     {
         Utils.Logger.Error(ex.ToString());
         ClsMsg.ShowErrMsg(ex.Message);
     }
 }
        public void UpdataDepartmentClass(DoWorkEventArgs e)
        {
            departmentBindingSource.EndEdit();
            this.strDepartmentNameNow = DepNameTextEdit.Text;
            Model = new SRDepartment.Department();
            Model = departmentBindingSource.DataSource as SRDepartment.Department;

            if (string.IsNullOrEmpty(DepNameTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForDepName.Text);
            }
            else
            {
                if (ClsMsg.ShowQuestionMsg("是否修改该模板数据?") == DialogResult.Yes)
                {
                    using (var upClient = new SRDepartment.DepartmentServiceClient())
                    {
                        var ret = upClient.UpdataDepartmentData(context.SessionID, Model, strDepartmentNameOriginal, strDepartmentNameNow);
                        if (ret.IsSuccess)
                        {
                            this.AddSysOperLogs(this.Text, OperateStatus.修改, strCode: Model.DepCode);
                            e.Result = true;
                            ClsMsg.ShowWarningMsg("数据更新完毕!");
                        }
                        else
                        {
                            e.Result = false;
                            bgWait.ReportProgress(101, ret.Message);
                        }
                    }
                }
            }
        }
Beispiel #4
0
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            // mainPipelineInfoBindingSource.DataSource = Model;
            OperatingTimeTextEdit.Text = DateTime.Now.ToString();
            CreateDateDateEdit.Text    = DateTime.Now.ToString();

            if (string.IsNullOrEmpty(DeveCodeTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForDeveCode.Text);
                DeveCodeTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(DeveNameTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForDeveName.Text);
                DeveNameTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(PipelineStatusTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForPipelineStatus.Text);
                PipelineStatusTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(PromptDesTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForPromptDes.Text);
                PromptDesTextEdit.Focus();
            }
            //else if (string.IsNullOrEmpty(OperatorReamrkTextEdit.Text))
            //{
            //    ClsMsg.ShowWarningEmptyMsg(ItemForOperatorReamrk.Text);
            //    OperatorReamrkTextEdit.Focus();
            //}
            else if (string.IsNullOrEmpty(FrequencyTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
                FrequencyTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(OperatorTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForOperator.Text);
                OperatorTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(CreatorTextEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForCreator.Text);
                CreatorTextEdit.Focus();
            }
            else if (string.IsNullOrEmpty(CreateDateDateEdit.Text))
            {
                ClsMsg.ShowWarningEmptyMsg(ItemForCreateDate.Text);
                CreateDateDateEdit.Focus();
            }
            else if (backgroundWorker.IsBusy == false)
            {
                if (ClsMsg.ShowQuestionMsg("是否保存当前操作?") == DialogResult.Yes)
                {
                    backgroundWorker.RunWorkerAsync("AddOperatingData");
                }
            }
        }
Beispiel #5
0
        private void bgWait_DoWork(object sender, DoWorkEventArgs e)
        {
            bgWait.ReportProgress(0);
            try
            {
                switch (e.Argument.ToString())
                {
                case "LoadArrangedVouchCodeList":
                    if (string.IsNullOrEmpty(te_Date.Text) == false)
                    {
                        using (AVClient = new SRArrangedVouch.ArrangedVServiceClient())
                        {
                            var mindate   = Convert.ToDateTime(te_Date.Text).Date;
                            var maxdate   = Convert.ToDateTime(te_Date.Text).Date.AddHours(23.99);
                            int iPageSize = (int)Page.PageSize;
                            int iCurrPage = (int)Page.CurrentPage;

                            Tuple <StringBuilder, List <object> > dtFilter = Tuple.Create <StringBuilder, List <object> >(new StringBuilder(), new List <object>());
                            dtFilter.Item1.Append("1=1");
                            FilterProcess.MergeFilterCondition("CreateTime", mindate, ref dtFilter, objValues1: maxdate, dataType: FilterProcess.DataType.DateTime);
                            //FilterProcess.MergeFilterCondition("CreateTime", maxdate, ref dtFilter, "<=", dataType: FilterProcess.DataType.DateTime);
                            FilterProcess.MergeFilterCondition("UserStatus", "1", ref dtFilter, "!=", dataType: FilterProcess.DataType.Int);

                            var ret = AVClient.GetArrangedVouchList(context.SessionID, Tuple.Create <string, object[]>(dtFilter.Item1.ToString(), dtFilter.Item2.ToArray()), iPageSize, iCurrPage);
                            if (ret.IsSuccess)
                            {
                                Page.PageSize    = iPageSize;
                                Page.CurrentPage = iCurrPage;
                                e.Result         = ret.Data;
                            }
                            else
                            {
                                ClsMsg.ShowInfoMsg(ret.Message);
                            }
                        }
                    }
                    else
                    {
                        ClsMsg.ShowWarningEmptyMsg(lb_Date.Text);
                    }
                    break;

                default:
                    break;
                }
            }
            catch (FaultException <SRZhuanGu.CustomFaultMessage> fex)
            {
                bgWait.ReportProgress(102, fex.Message);
                Utils.Logger.Error(fex.ToString());
            }
            catch (Exception ex)
            {
                bgWait.ReportProgress(102, ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
            bgWait.ReportProgress(100);
        }
Beispiel #6
0
        private void bmTool_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "bbtniSave":
                    //EndEditOnAllBindingSources();
                    deviceBindingSource.EndEdit();
                    if (model.DevCode.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForDevCode.Text);
                        DevCodeTextEdit.Focus();
                    }
                    else if (model.DevName.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForDevName.Text);
                        DevNameTextEdit.Focus();
                    }
                    else if (model.DevCCode.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForDevCCode.Text);
                        DevCCodeTextEdit.Focus();
                    }
                    else if (ClsMsg.ShowQuestionMsg("是否要保存设备档案信息呢?") == DialogResult.Yes)
                    {
                        bgwWait.RunWorkerAsync("SaveData");
                    }
                    break;

                case "bbtniDel":
                    if (strDevCode.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningMsg("无任何数据可删除!");
                        return;
                    }
                    if (ClsMsg.ShowQuestionMsg("是否要删除设备档案呢?") == DialogResult.Yes)
                    {
                        bgwWait.RunWorkerAsync("DeleteData");
                    }
                    break;

                case "bbtniExit":
                    this.Close();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
        }
Beispiel #7
0
 private void bt_Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(EnumTypeTextEdit.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForEnumType.Text);
         }
         else if (string.IsNullOrEmpty(TypeNameTextEdit.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForTypeName.Text);
         }
         else if (string.IsNullOrEmpty(EnumCodeTextEdit.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForEnumCode.Text);
         }
         else if (string.IsNullOrEmpty(ItemForEnumCode.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForEnumName.Text);
         }
         else if (string.IsNullOrEmpty(IOrderTextEdit.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForIOrder.Text);
         }
         else if (string.IsNullOrEmpty(SysCodeTextEdit.Text))
         {
             ClsMsg.ShowWarningEmptyMsg(ItemForSysCode.Text);
         }
         else
         {
             if (bgWait.IsBusy == false)
             {
                 if (AutoIDSpinEdit.Text != "0")
                 {
                     if (ClsMsg.ShowQuestionMsg("是否保存修改后的数据?") == System.Windows.Forms.DialogResult.Yes)
                     {
                         bgWait.RunWorkerAsync("UpdateDateDictionary");
                     }
                 }
                 else
                 {
                     if (ClsMsg.ShowQuestionMsg("是否保存新增数据?") == System.Windows.Forms.DialogResult.Yes)
                     {
                         bgWait.RunWorkerAsync("AddDateDictionary");
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Utils.Logger.Error(ex.ToString());
         ClsMsg.ShowInfoMsg(ex.Message);
     }
 }
Beispiel #8
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     qCFindLeakDrumsSetBindingSource.EndEdit();
     qCFindLeakDrumsSetDetailBindingSource.EndEdit();
     if (model.Frequency.IsNullOrEmpty())
     {
         ClsMsg.ShowWarningEmptyMsg(ForItemFrequency.Text);
         FrequencyTextEdit.Focus();
     }
     else if (detailList.Count == 0)
     {
         ClsMsg.ShowWarningMsg("未选择需要检漏转鼓信息,请选择转鼓");
     }
     else
     {
         bgwWait.RunWorkerAsync("SaveData");
     }
 }
Beispiel #9
0
        private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                qCPullDetectionRegBindingSource.EndEdit();
                switch (e.Item.Name)
                {
                case "bbtniSave":

                    if (model.RegDate.ToString().IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForRegDate.Text);
                        RegDateDateEdit.Focus();
                    }
                    else if (model.QualityInspector.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForQualityInspector.Text);
                        QualityInspectorTextEdit.Focus();
                    }
                    else if (model.Frequency.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForFrequency.Text);
                        FrequencyTextEdit.Focus();
                    }
                    else if (model.ProductionLine.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForProductionLine.Text);
                        ProductionLineTextEdit.Focus();
                    }
                    else if (model.OrderCode.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForOrderCode.Text);
                        OrderCodeTextEdit.Focus();
                    }
                    else if (model.ProductLevel.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForProductLevel.Text);
                        ProductLevelComboBoxEdit.Focus();
                    }
                    else if (model.TestResults.IsNullOrEmpty())
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForTestResults.Text);
                        //TestResultsTextEdit.Focus();
                    }
                    else
                    {
                        if (ClsMsg.ShowQuestionMsg("是否要保存当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("SaveData");
                        }
                    }
                    break;

                case "bbtniStart":
                    if (bbtniStart.Caption.Equals("开始检测"))
                    {
                        if (model.ProductLevel.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForProductLevel.Text);
                            ProductLevelComboBoxEdit.Focus();
                        }
                        else if (model.OrderType.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForOrderType.Text);
                        }
                        else if (model.Width.HasValue == false)
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForWidth.Text);
                        }
                        else if (model.Thick.HasValue == false)
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForThick.Text);
                        }
                        else if (dtPullRule == null || dtPullRule.Rows.Count == 0)
                        {
                            ClsMsg.ShowWarningMsg("请先维护拉力检测计算规则!");
                        }
                        else
                        {
                            iNum = 0;
                            bool bSuccess = mp.Open("COM7");
                            if (bSuccess)
                            {
                                timer1.Start();
                                bbtniStart.Caption = "停止检测";
                            }
                            else
                            {
                                ClsMsg.ShowWarningMsg(mp.modbusMsg);
                            }
                        }
                    }
                    else
                    {
                        timer1.Stop();
                        mp.Close();
                        //   model.ActualPull = 0;
                        //   model.TestResults = "aaa";
                        //   ItemCurrPull.Text = "0";
                        qCPullDetectionRegBindingSource.DataSource = model;
                        //#if DEBUG
                        //                            model.ActualPull = Convert.ToDecimal(textEdit1.Text);
                        //#endif


                        bbtniStart.Caption = "开始检测";
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
        }
Beispiel #10
0
        private void bmTool_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (bgwWait.IsBusy == false)
                {
                    switch (e.Item.Name)
                    {
                    case "bbtniAdd":
                        DevCCodeTextEdit.Properties.ReadOnly = false;
                        model = new SRDevice.DeviceClass()
                        {
                            Grade = 0
                        };
                        deviceClassBindingSource.DataSource = model;
                        break;

                    case "bbtniSave":
                        deviceClassBindingSource.EndEdit();

                        if (model == null)
                        {
                            ClsMsg.ShowWarningMsg("无任何可保存的数据!");
                        }
                        else if (model.DevCCode.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForDevCCode.Text);
                            DevCCodeTextEdit.Focus();
                        }
                        else if (model.DevCName.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForDevCName.Text);
                            DevCNameTextEdit.Focus();
                        }
                        else if (ClsMsg.ShowQuestionMsg("是否要保存当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("SaveData");
                        }
                        break;

                    case "bbtniDel":
                        deviceClassBindingSource.EndEdit();
                        if (model != null && ClsMsg.ShowQuestionMsg("是否要删除当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("DelData");
                        }
                        break;

                    case "bbtniExit":
                        this.Close();
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
        }
Beispiel #11
0
        private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (BgWait2.IsBusy == false)
                {
                    switch (e.Item.Name)
                    {
                    case "bbtniAdd":

                        EndEditOnAllBindingSources();
                        if (strDeviCode.IsNullOrEmpty() && ClsMsg.ShowQuestionMsg("是否要保存设备档案信息呢?") == DialogResult.Yes)
                        {
                            BgWait2.RunWorkerAsync("SaveData");
                        }

                        else if (CollFrequencyTextEdit.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForCollFrequency.Text);
                            CollFrequencyTextEdit.Focus();
                        }
                        else if (UserStatusSpinEdit.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForUserStatus.Text);
                            UserStatusSpinEdit.Focus();
                        }

                        else
                        {
                            if (ClsMsg.ShowQuestionMsg("是否要修改设备档案信息呢?") == DialogResult.Yes)
                            {
                                EndEditOnAllBindingSources();
                                BgWait2.RunWorkerAsync("UpdData");
                            }
                        }
                        break;

                    case "bbtniUpdate":


                        BgWait2.RunWorkerAsync("UpdData");

                        break;

                    case "bbtniDelete":

                        if (strDeviCode.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningMsg("无任何数据可删除!");
                            return;
                        }
                        if (ClsMsg.ShowQuestionMsg("是否要删除设备档案呢?") == DialogResult.Yes)
                        {
                            BgWait2.RunWorkerAsync("Delete");
                        }

                        break;

                    case "bbtnExit":

                        this.Close();


                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.ToString());
            }
        }
Beispiel #12
0
        private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (bgwWait.IsBusy == false)
                {
                    switch (e.Item.Name)
                    {
                    case "bbtniAdd":
                        headModel = new SRCLParamSet.CraftsLineParamSet();
                        headModel.CreateDateTime = DateTime.Now;
                        headModel.Creator        = context.UserName;
                        craftsLineParamSetBindingSource.DataSource = headModel;
                        lstbodyModel = new List <SRCLParamSet.VCraftsLineParamSetDetail>();
                        //lstbodyModel.Add(new SRCLParamSet.CraftsLineParamSets());
                        craftsLineParamSetsBindingSource.DataSource = lstbodyModel;
                        gridControl1.RefreshDataSource();
                        break;

                    case "bbtniSave":
                        gvDetail.CloseEditor();
                        craftsLineParamSetBindingSource.EndEdit();
                        craftsLineParamSetsBindingSource.EndEdit();
                        if (headModel.CraftsName.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForCraftsName.Text);
                            CraftsNameButtonEdit.Focus();
                            return;
                        }
                        else if (headModel.WorkShop.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForWorkShop.Text);
                            WorkShopTextEdit.Focus();
                            return;
                        }
                        else if (headModel.Treatment.IsNullOrEmpty())
                        {
                            ClsMsg.ShowWarningEmptyMsg(ItemForTreatment.Text);
                            TreatmentLookUpEdit.Focus();
                            return;
                        }
                        else if (headModel.Treatment.Equals("1") && (headModel.CraftsTaskTime.HasValue == false || headModel.CraftsTaskTime.Value <= 0))
                        {
                            ClsMsg.ShowWarningMsg("处理方式为:自动,工艺总耗时不能小于零或为空!");
                            CraftsTaskTimeCalcEdit.Focus();
                            return;
                        }
                        else if (headModel.Order <= 0)
                        {
                            ClsMsg.ShowWarningMsg(ItemForOrder.Text + "不能小于等于零!");
                            OrderSpinEdit.Focus();
                            return;
                        }
                        else if (headModel.Treatment.Equals("1") && lstbodyModel.Count == 0)
                        {
                            ClsMsg.ShowWarningMsg("处理方式为:自动,工艺参数明细不能为空!");
                            return;
                        }
                        else if (lstbodyModel.Count > 0)
                        {
                            //if (lstbodyModel.Where(t => (t.Editprop.IsNullOrEmpty() || t.Editprop != "D")).OrderBy(t => t.Priority).First().Priority != 0)
                            //{
                            //    ClsMsg.ShowWarningMsg("工艺参数明细优先级没有开始参数");
                            //    return;
                            //}
                            //else
                            if (headModel.Treatment == "1")     //处理方式:自动,判断必须有结束
                            {
                                if (lstbodyModel.Where(t => (t.Editprop.IsNullOrEmpty() || t.Editprop != "D")).OrderByDescending(t => t.Priority).First().Priority != 100)
                                {
                                    ClsMsg.ShowWarningMsg("工艺参数明细优先级没有结束参数");
                                    return;
                                }
                            }

                            for (int i = 0; i < lstbodyModel.Count; i++)
                            {
                                var item = lstbodyModel[i];
                                if (item.Editprop.IsNullOrEmpty() || item.Editprop.Equals("E"))
                                {
                                    if (item.ParameterID == 0)
                                    {
                                        ClsMsg.ShowWarningEmptyMsg(string.Format("第{0}行参数名称", i.ToString()));
                                        return;
                                    }
                                    else if (item.UserStatus.IsNullOrEmpty())
                                    {
                                        ClsMsg.ShowWarningEmptyMsg(string.Format("第{0}行使用状态", i.ToString()));
                                        return;
                                    }
                                }
                            }
                        }
                        if (ClsMsg.ShowQuestionMsg("是否要保存当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("SaveData");
                        }
                        break;

                    case "bbtniDel":
                        if (ClsMsg.ShowQuestionMsg("是否要删除当前数据呢?") == DialogResult.Yes)
                        {
                            bgwWait.RunWorkerAsync("DelData");
                        }
                        break;

                    case "bbtniDelRow":
                        var curr = lstbodyModel.Where(t => t.Editprop != "D").ToList()[gvDetail.FocusedRowHandle];
                        curr.Editprop = "D";
                        craftsLineParamSetsBindingSource.DataSource = lstbodyModel;
                        gridControl1.RefreshDataSource();
                        break;

                    case "bbtniAddRow":
                        lstbodyModel.Add(new SRCLParamSet.VCraftsLineParamSetDetail()
                        {
                            ID         = headModel.ID,
                            Editprop   = "A",
                            UserStatus = "0"
                        });
                        craftsLineParamSetsBindingSource.DataSource = lstbodyModel;
                        gridControl1.RefreshDataSource();
                        break;

                    case "bbtniExit":
                        this.Close();
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.Logger.Error(ex.ToString());
                ClsMsg.ShowErrMsg(ex.Message);
            }
        }
Beispiel #13
0
        private void barManager_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                switch (e.Item.Name)
                {
                case "bbtniSave":
                    if (string.IsNullOrEmpty(PersonCodeTextEdit.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForPersonCode.Text);
                    }
                    else if (string.IsNullOrEmpty(PersonNameTextEdit.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForPersonName.Text);
                    }
                    else if (string.IsNullOrEmpty(PersonTypeTextEdit.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForPersonType.Text);
                    }
                    else if (IsOperatorCheckEdit.CheckState.Equals(CheckState.Checked) && string.IsNullOrEmpty(OparatorNameTextEdit.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForOparatorName.Text);
                    }
                    else if (IsOperatorCheckEdit.CheckState.Equals(CheckState.Checked) && string.IsNullOrEmpty(ItemForOparatorCode.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForOparatorCode.Text);
                    }
                    else if (bgWait.IsBusy == false)
                    {
                        if (ClsMsg.ShowQuestionMsg("是否保存该职员数据?") == DialogResult.Yes)
                        {
                            bgWait.RunWorkerAsync("SavePersonData");
                        }
                    }
                    break;

                case "bbtniDelete":
                    if (string.IsNullOrEmpty(PersonCodeTextEdit.Text))
                    {
                        ClsMsg.ShowWarningEmptyMsg(ItemForPersonCode.Text);
                    }
                    else if (bgWait.IsBusy == false)
                    {
                        if (ClsMsg.ShowQuestionMsg("是否删除该职员数据?") == DialogResult.Yes)
                        {
                            bgWait.RunWorkerAsync("DeletePersonData");
                        }
                    }
                    break;

                case "bbtniExit":
                    this.Close();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                ClsMsg.ShowErrMsg(ex.Message);
                Utils.Logger.Error(ex.ToString());
            }
        }