private void btnClear_Click(object sender, RoutedEventArgs e) { try { btnClear.IsEnabled = false; int retValue; if (int.Parse(cboRemedy.SelectedValue.ToString()) < 1) { MessageBox.ShowBox("MessageID143", BMC_Icon.Information); return; } if (txtNotes.Text == "") { MessageBox.ShowBox("MessageID144", BMC_Icon.Information); return; } if (MessageBox.ShowBox("MessageID145", BMC_Icon.Question, BMC_Button.YesNo) == System.Windows.Forms.DialogResult.Yes) { retValue = fieldService.CloseServiceCall(9999999, txtJobID.Text, int.Parse(cboRemedy.SelectedValue.ToString()), Security.SecurityHelper.CurrentUser.SecurityUserID, txtNotes.Text); if (retValue == 10) { MessageBox.ShowBox("MessageID146", BMC_Icon.Information); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Cleared Service for " + txtJobID.Text, AuditOperationType = OperationType.MODIFY, Audit_Slot = Asset, Audit_Field = "JOB ID", Audit_New_Vl = txtJobID.Text }); this.Close(); } else if (retValue == 99) { MessageBox.ShowBox("MessageID147", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Service Call was not cleared.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); return; } else { MessageBox.ShowBox("MessageID148", BMC_Icon.Error); AuditViewerBusiness.InsertAuditData(new Audit.Transport.Audit_History { AuditModuleName = ModuleName.FieldServices, Audit_Screen_Name = "Position Details|Field Services", Audit_Desc = "Failed while clearing a Service call.", AuditOperationType = OperationType.ADD, Audit_Slot = Asset }); } } } finally { btnClear.IsEnabled = true; } }