/// <summary> /// 按钮点击事件-申领模具 /// </summary> /// <param name="sender">事件源</param> /// <param name="e">事件参数</param> private void MoldApplyBtn_Click(object sender, RoutedEventArgs e) { if ((ToolingManWPF.ConditionServiceReference.MoldStateType)moldBaseInfo.State != ToolingManWPF.ConditionServiceReference.MoldStateType.Normal && (MoldUseType)int.Parse(MoldUseWayCB.SelectedValue.ToString()) == MoldUseType.Produce) { MessageBox.Show("模具目前状态不可用作正产!"); return; } if (!string.IsNullOrWhiteSpace(EnsureMoldNRTB.Text) && !string.IsNullOrWhiteSpace(ApplicantNRTB.Text) && !string.IsNullOrWhiteSpace(WorkstationNRTB.Text)) { if (MoldNRTB.Text.Equals(EnsureMoldNRTB.Text)) { ConditionServiceClient conditionclient = new ConditionServiceClient(); BasicMessage bmsg = new BasicMessage(); if (!conditionclient.EmpExist(ApplicantNRTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("申领员工"); } if (!conditionclient.WorkstationExist(WorkstationNRTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("工作台"); } if (bmsg.Result == false) { MessageBox.Show(bmsg.MsgText + " 不存在,请重新输入"); return; } StorageManageServiceClient client = new StorageManageServiceClient(); Message msg = client.ApplyMold((MoldUseType)int.Parse(MoldUseWayCB.SelectedValue.ToString()), MoldNRTB.Text, ApplicantNRTB.Text, "", WorkstationNRTB.Text); MessageBoxResult result = MessageBox.Show(msg.Content); if (result == MessageBoxResult.OK) { this.Close(); } } else { MessageBox.Show("确认模具号 与 模具号不一致"); } } else { MessageBox.Show("请完整填写 申领员工号,压接机号,确认模具号"); } }