private void DeveCodeTextEdit_EditValueChanged(object sender, EventArgs e) { if (model != null) { if (DeveCodeTextEdit.Text.Length == 6) { var currDrums = lstVW_QC_FindLeakDrumsSet.Where(t => t.DevCode == DeveCodeTextEdit.Text).FirstOrDefault(); if (currDrums != null) { model.DevCode = currDrums.DevCode; model.DevName = currDrums.DevName; model.SourceCode = currDrums.ArrangedVouchCode.ToString(); } else { model.DevCode = null; model.DevName = null; model.SourceCode = null; ClsMsg.ShowWarningMsg("该转鼓未设定检漏或已经检漏。"); } } else { model.DevCode = null; model.DevName = null; model.SourceCode = null; } } }
private void bt_Del_Click(object sender, EventArgs e) { try { uAEnumBindingSource.EndEdit(); Model = uAEnumBindingSource.DataSource as UA_Enum; if (Model.EnumType == null) { ClsMsg.ShowInfoMsg("请选择要删除的数据"); } else { if (bgWait.IsBusy == false) { if (ClsMsg.ShowQuestionMsg("是否要删除该字典名称?") == System.Windows.Forms.DialogResult.Yes) { bgWait.RunWorkerAsync("DelDateDictionary"); } } } } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); ClsMsg.ShowInfoMsg(ex.Message); } }
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); } } } } }
private void simpleButton1_Click(object sender, EventArgs e) { var result = Client.Utility.BarCode.frmScannCode1.Instance(); if (result.IsNullOrEmpty() == false) { var currDrums = lstVW_QC_FindLeakDrumsSet.Where(t => t.DevCode == result).FirstOrDefault(); if (currDrums != null) { model.DevCode = currDrums.DevCode; model.DevName = currDrums.DevName; model.SourceCode = currDrums.ArrangedVouchCode; } else { model.DevCode = null; model.DevName = null; ClsMsg.ShowWarningMsg("该转鼓未设定检漏或已经检漏。"); } } else { model.DevCode = null; model.DevName = null; } //BgWait.RunWorkerAsync("SearchData");//提交页面数据 }
private void barManager2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (backgroundWorker1.IsBusy == false) { switch (e.Item.Name) { case "ButAdd": if (gmc.GetSelectedRows().Count > 0) { this.DialogResult = DialogResult.OK; } else { ClsMsg.ShowWarningMsg("请勾选检漏的转鼓"); } break; case "ButExit": this.Close(); break; default: break; } } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
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); } } } } }
private void SaveFun() { try { using (SRUserRole.UserRoleServiceClient client = new SRUserRole.UserRoleServiceClient()) { SRUserRole.CommonResult resData = null; var model = modelSource.DataSource as SRUserRole.UAD_Role; if (model != null) { if (EidtStatus == 0) { resData = client.AddRole(model); } else { resData = client.EditRole(model); } if (resData.IsSuccess) { ClsMsg.ShowInfoMsg("保存成功!"); } else { ClsMsg.ShowErrMsg(resData.Message); } } } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
private void ToolStripMenuItem_Click(object sender, EventArgs e) { try { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Title = "截图"; saveFileDialog.Filter = "Jpeg文件(*.jpg)|*.jpg"; DialogResult dialogResult = saveFileDialog.ShowDialog(this); if (dialogResult == DialogResult.OK) { if (SourceControlName == "Temperature_Chart") { Temperature_Chart.ExportToImage(saveFileDialog.FileName, System.Drawing.Imaging.ImageFormat.Png); } else if (SourceControlName == "Vacuo_Chart") { Vacuo_Chart.ExportToImage(saveFileDialog.FileName, System.Drawing.Imaging.ImageFormat.Png); } ClsMsg.ShowInfoMsg(saveFileDialog.FileName + " 保存成功!"); } } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); //ClsMsg.ShowInfoMsg(ex.Message); lb_Prompt.Text = ex.Message; } }
private void OparatorNameTextEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { if (OparatorNameTextEdit.Properties.ReadOnly == false) { var frmUser = new frmUserList(context); if (frmUser.ShowDialog() == DialogResult.OK) { if (frmUser.Tag != null) { var UserModel = frmUser.Tag as Client.Utility.SRSysBase.User; Model.OparatorName = UserModel.cUserName; Model.OparatorCode = UserModel.cUserCode; personBindingSource.DataSource = Model; } } } } catch (Exception ex) { ClsMsg.ShowInfoMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } }
private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { switch (e.Item.Name) { case "bbtniAdd": EidtStatus = 0; modelSource.DataSource = new SRUserRole.UAD_Role(); break; case "bbtniSave": SaveFun(); break; case "bbtniDel": break; case "bbtniQuit": this.Close(); break; default: break; } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
private void IsOperatorCheckEdit_CheckStateChanged(object sender, EventArgs e) { try { if (IsOperatorCheckEdit.CheckState == (CheckState.Checked)) { OparatorCodeTextEdit.Properties.ReadOnly = false; OparatorNameTextEdit.Properties.ReadOnly = false; } else if (IsOperatorCheckEdit.CheckState == (CheckState.Unchecked)) { OparatorCodeTextEdit.Properties.ReadOnly = true; OparatorNameTextEdit.Properties.ReadOnly = true; Model.OparatorCode = ""; Model.OparatorName = ""; //this.OparatorNameTextEdit.Text = null; //this.OparatorCodeTextEdit.Text = null; } } catch (Exception ex) { ClsMsg.ShowInfoMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } }
private void bgWait_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (e.Result != null) { if (e.Result is SRPersonInfo.Person) { if (ClsMsg.ShowQuestionMsg("数据新增成功!\n 是否继续新增职员档案?") == DialogResult.Yes) { AddPersonData(); } else { this.DialogResult = DialogResult.OK; } } else if (e.Result is bool) { this.DialogResult = DialogResult.OK; } } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } }
private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { switch (e.Item.Name) { case "bbtniCarftsExecute": if (gridView1.FocusedRowHandle >= 0) { string ArrangedVouchCode = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ArrangedVouchCode").ToString(); frmCfPExecute frm = new frmCfPExecute(context, ArrangedVouchCode); frm.ShowDialog(); } break; case "bbtniDetails": if (gridView1.FocusedRowHandle >= 0) { string ArrangedVouchCode = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ArrangedVouchCode").ToString(); frmArrangedVouch frm = new frmArrangedVouch(context, ArrangedVouchCode); frm.ShowDialog(); } break; default: break; } } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); ClsMsg.ShowErrMsg(ex.Message); } }
/// <summary> /// 连接设备 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button4_Click(object sender, EventArgs e) { if (ClsMsg.ShowQuestionMsg("是否连接设备?") == DialogResult.Yes) { button4.Enabled = false; try { // 获取到本机IP GetServerIP(); //自动获取到本机电脑端口 // IP = IPAddress.Parse("192.168.1.238"); IP = IPAddress.Parse("192.168.1.238"); int point = Convert.ToInt32("8899"); endpoint = new IPEndPoint(IP, point); //建立Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); CollectTime.Start(); System.Threading.Thread th = new System.Threading.Thread(this.ToConnect); th.Start(); } catch (Exception ex) { MessageBox.Show("连接尚未建立!无法发送数据!" + ex.Message); } } }
//添加 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); } }
/// <summary> /// 单据体 参照控件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal void HeadRefer_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { //if (string.IsNullOrEmpty(e.Button.Caption) == false && model != null && model.Rows.Count > 0) //{ // var currControl = sender as ButtonEdit; // var Ret = FilterConditions.FilterProcess(Context, e.Button.Caption.ToString(), false, null, currControl.Text, null); // DataRow dRow = model.Rows[0]; // if (Ret != null) // { // if (Ret.Item1 != null && Ret.Item1.Rows.Count > 0) // { // for (int i = 0; i < Ret.Item1.Rows.Count; i++) // { // foreach (DataColumn item in Ret.Item1.Columns) // { // if (dRow.Table.Columns.Contains(item.ColumnName)) // { // dRow[item.ColumnName] = Ret.Item1.Rows[i][item.ColumnName]; // } // } // } // } // model.AcceptChanges(); // //modelSource.EndEdit(); // } //} } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
//新增字典子集 private void tsmi_AddEnumSubset_Click(object sender, EventArgs e) { try { if (tv_DateDictionary.SelectedNode == null) { ClsMsg.ShowInfoMsg("请先选择要增加子项的字典类型!"); } else { Model = new UA_Enum { EnumType = tv_DateDictionary.SelectedNode.Name, TypeName = tv_DateDictionary.SelectedNode.Tag.ToString(), SysCode = context.SysCode }; uAEnumBindingSource.DataSource = Model; EnumTypeTextEdit.Properties.ReadOnly = true; TypeNameTextEdit.Properties.ReadOnly = true; } } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); ClsMsg.ShowInfoMsg(ex.Message); } }
private void CfPExecute_Load(object sender, EventArgs e) { try { var ExecuteStatus = DataEnum.GetEnumData(context, "CF.ExecuteStatus"); ExecuteModeTextEdit.Properties.DataSource = DataEnum.GetEnumData("treatment"); riluePriority.DataSource = DataEnum.GetEnumData(context, "CF.Priority"); repositoryItemExecuteStatusLookUpEdit.DataSource = ExecuteStatus; ExecuteStatusTextEdit.Properties.DataSource = ExecuteStatus; this.AddSysOperLogs(this.Text, OperateStatus.查询); using (SRBase.BaseServiceClient client = new SRBase.BaseServiceClient()) { var ret = client.GetCraftsParameterContrastList(context.SessionID); if (ret.IsSuccess) { rilueParameterName.DataSource = ret.Data; } else { ClsMsg.ShowWarningMsg(ret.Message); } } bgwWait.RunWorkerAsync("LoadTreeData"); } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); ClsMsg.ShowErrMsg(ex.Message); } }
private void bgWait_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (e.Result != null) { if (e.Result is UA_Enum[]) { bindingSource.DataSource = e.Result; } else if (e.Result is bool) { if ((bool)e.Result) { bgWait.RunWorkerAsync("LoadDateDictionaryList"); } } else if (e.Result.ToString() == "LoadTreeDate") { bgWait.RunWorkerAsync("LoadTreeDate"); } Model = new UA_Enum(); uAEnumBindingSource.DataSource = Model; EnumTypeTextEdit.Properties.ReadOnly = false; TypeNameTextEdit.Properties.ReadOnly = false; } } catch (Exception ex) { Utils.Logger.Error(ex.ToString()); ClsMsg.ShowInfoMsg(ex.Message); } }
private void bgwWait_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null) { if (e.Result is SRBase.CraftsParameterContrast[]) { lstCPContrast = new List <CPContrast>(); (e.Result as SRBase.CraftsParameterContrast[]).ToList().ForEach(item => { lstCPContrast.Add(new CPContrast(item)); }); cPContrastBindingSource.DataSource = lstCPContrast; } else if (e.Result is bool) { if (Convert.ToBoolean(e.Result)) { lstCPContrast.Remove(gridView1.GetRow(gridView1.FocusedRowHandle) as CPContrast); cPContrastBindingSource.DataSource = lstCPContrast; gridControl1.RefreshDataSource(); ClsMsg.ShowInfoMsg("删除成功!"); } } } }
private void frmPullDetectionReg_Load(object sender, EventArgs e) { try { ProcessTypeSpinEdit.Properties.DataSource = TProcessType; AddFun(); this.BeginInvoke((MethodInvoker) delegate() { using (SRQZData.QZDataServiceClient client = new SRQZData.QZDataServiceClient()) { var data = client.GetQualityInspector(context.SessionID); this.Invoke((MethodInvoker) delegate() { QualityInspectorTextEdit.Properties.DataSource = data; }); dtPullRule = client.GetPullCompute(context.SessionID); } }); } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } }
/// <summary> /// 工具栏事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { if (backgroundWorker1.IsBusy == false) { switch (e.Item.Name) { case "bbtiEnsure": string b = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DevpCode").ToString(); DevpCode = b; this.DialogResult = DialogResult.OK; break; case "bbtiExit": this.Close(); break; default: break; } } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
private void OrderCodeTextEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { frmOrderChoose frm = new frmOrderChoose(context); if (frm.ShowDialog() == DialogResult.OK) { model.OrderType = frm.OrderType; model.OrderCode = frm.OrderID; model.ProductionLine = string.Format("{0}{1}", frm.Machine, frm.LineNum); model.Strength = frm.Strength; if (frm.Specifications.IsNullOrEmpty() == false) { model.Width = Convert.ToDecimal(frm.Specifications.Substring(0, 3)) / 10; model.Thick = Convert.ToDecimal(frm.Specifications.Substring(3, 3)) / 100; } else { model.Width = 0; model.Thick = 0; } model.StandardPull = model.Width * model.Thick * Convert.ToDecimal((frm.Strength.Replace("强", ""))); } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } }
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { backgroundWorker.ReportProgress(0); try { switch (e.Argument.ToString()) { case "SearchData": GetOperatingData(e); break; default: break; } } catch (System.ServiceModel.FaultException <CustomFaultMessage> fex) { backgroundWorker.ReportProgress(102, fex.Message); Utils.Logger.Error(fex.ToString()); } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.Message); Utils.Logger.Error(ex.ToString()); } backgroundWorker.ReportProgress(100); }
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"); } } }
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); }
private void button6_Click(object sender, EventArgs e) { Byte[] bs; if (ClsMsg.ShowQuestionMsg("是否要打开排水阀门?") == DialogResult.Yes) { bs = System.Text.Encoding.UTF8.GetBytes("XXL-0-53"); //发现UTF8可支持中文,就用之 socket.BeginSend(bs, 0, bs.Length, 0, new AsyncCallback(SendCallback), socket); } }
/// <summary> /// barManager控件响应事件,打开新窗体,传入参数区分新增跟修改,等待窗体数据返回更新列表数据 /// lastupdata:20161115XXQ /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barManager1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { frmExecute AddExetue = null; strDeviCode = null; if (BgWait1.IsBusy == false) { switch (e.Item.Name) { case "bbtniAdd": AddExetue = new frmExecute(context, strDeviCode); if (AddExetue.ShowDialog() == DialogResult.OK) { BgWait1.RunWorkerAsync("SearchData"); } break; case "bbtniUpdate": if (gridView1.FocusedRowHandle >= 0) { var model1 = gridView1.GetRow(gridView1.FocusedRowHandle) as SRExcute.DeviceExecute; AddExetue = new frmExecute(context, model1.DeviCode); if (AddExetue.ShowDialog() == DialogResult.OK) { BgWait1.RunWorkerAsync("SearchData"); } } else { ClsMsg.ShowWarningMsg("选中要修改的设备信息"); } break; case "bbtnExit": this.Close(); break; default: break; } } } catch (Exception ex) { ClsMsg.ShowErrMsg(ex.ToString()); } }
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()); } }
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); } }