/// <summary> /// 按钮点击事件-模具入库 /// </summary> /// <param name="sender">事件源</param> /// <param name="e">事件参数</param> private void MoldInStoreBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(MoldNRTB.Text) || string.IsNullOrWhiteSpace(ApplicantNRTB.Text)) { MessageBox.Show("请将 模具号,退料员工号 填写完整"); } else { BasicMessage bmsg = new BasicMessage(); ConditionServiceClient conditionclient = new ConditionServiceClient(); if (!conditionclient.MoldExist(MoldNRTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("模具"); } if (ApplicantNRTB.Text.Length != 0 && !conditionclient.EmpExist(ApplicantNRTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("退料员工"); } if (bmsg.Result == false) { MessageBox.Show(bmsg.MsgText + " 不存在,请重新输入"); return; } StorageManageServiceClient client = new StorageManageServiceClient(); // Message msg = client.MoldInStore(MoldNRTB.Text, OperatorTB.Text, WarehouseNRTB.Text, PositionNRTB.Text); Message msg = client.ReturnMoldInPosition(MoldNRTB.Text, ApplicantNRTB.Text, RemarkTB.Text); MessageBoxResult result = MessageBox.Show(msg.Content); if (result == MessageBoxResult.OK) { this.Close(); } if (msg.MsgType == MsgType.OK) { MoldInStoreBtn.IsEnabled = false; } } }
/// <summary> /// 按钮点击事件-模具入库 /// </summary> /// <param name="sender">事件源</param> /// <param name="e">事件参数</param> private void OKBtn_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(MoldNRTB.Text) || string.IsNullOrWhiteSpace(OperatorTB.Text) ) { MessageBox.Show("请将 模具号,操作员号 填写完整"); } else { ConditionServiceClient conditionclient = new ConditionServiceClient(); BasicMessage bmsg = new BasicMessage(); if (!conditionclient.MoldExist(MoldNRTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("模具"); } if (OperatorTB.Text.Length != 0 && !conditionclient.EmpExist(OperatorTB.Text)) { bmsg.Result = false; bmsg.MsgContent.Add("操作员"); } if (bmsg.Result == false) { MessageBox.Show(bmsg.MsgText + " 不存在,请重新输入"); return; } StorageManageServiceClient client = new StorageManageServiceClient(); // Message msg = client.MoldInStore(MoldNRTB.Text, OperatorTB.Text, WarehouseNRTB.Text, PositionNRTB.Text); Message msg = client.ReturnMoldInPosition(MoldNRTB.Text, OperatorTB.Text, RemarkTB.Text); MessageBoxResult result = MessageBox.Show(msg.Content); if (result == MessageBoxResult.OK) { this.Close(); } } }