public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var SaveProcessControlInformation = (ERP_ProcessControl)CollectionViewSource.GetDefaultView(Production.ProcessControlGrid.DataContext).CurrentItem; //Checking if all controls are in valid state if (!Helper.IsValid(Production.ProcessControlGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (Production.BtnAdd.IsChecked == true) { if (!client.ExistProcessControl(SaveProcessControlInformation)) { ApiAck ack = client.CreateProcessControl(SaveProcessControlInformation); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateProcessControl(SaveProcessControlInformation); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var BankAccountToSave = (FIN_BankAccount)CollectionViewSource.GetDefaultView(bank.BankAccountGrid.DataContext).CurrentItem; //This is used incase a user never enters a textbox but still needs validating bank.BankAccountBankBranchDropDown.GetBindingExpression(CustomSearchDropDown.CustomSelectedItemProperty).UpdateSource(); bank.txt_BankAccount_AccountSEQNo.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //Checking if all controls are in valid state if (!Helper.IsValid(bank.BankAccountGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (bank.BtnAdd.IsChecked == true) { if (!client.BankAccountExists(BankAccountToSave)) { ApiAck ack = client.CreateBankAccount(BankAccountToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateBankAccount(BankAccountToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var AgentBrokerSalesManToSave = (ERP_AgentBrokerSalesMan)CollectionViewSource.GetDefaultView(agentbrokersalesman.AgentBrokerSalesManGrid.DataContext).CurrentItem; //This is used incase a user never enters a textbox but still needs validating agentbrokersalesman.cmb_AgentBrokerSalesManFlag.GetBindingExpression(TextBox.TextProperty).UpdateSource(); agentbrokersalesman.txt_Code.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //agentbrokersalesman.txt_ProductCodeLTI.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //agentbrokersalesman.txt_SubSystemCodeLTI.GetBindingExpression(TextBox.TextProperty).UpdateSource(); //Checking if all controls are in valid state if (!Helper.IsValid(agentbrokersalesman.AgentBrokerSalesManGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (agentbrokersalesman.BtnAdd.IsChecked == true) { var absmtosave = (AgentBrokerSalesManToSave); if (!client.AgentBrokerSalesManExists(absmtosave)) { ApiAck ack = client.CreateAgentBrokerSalesMan(absmtosave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateAgentBrokerSalesMan(AgentBrokerSalesManToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var EmployeeExpToSave = (HR_EMP_WORK_EXPERIENCE)CollectionViewSource.GetDefaultView(HREmployeeWorkExperienceUI.EMPWORKGrid.DataContext).CurrentItem; //This is used incase a user never enters a textbox but still needs validating HREmployeeWorkExperienceUI.HREmployeeWEDropDown.GetBindingExpression(CustomSearchDropDown.CustomSelectedItemProperty).UpdateSource(); HREmployeeWorkExperienceUI.txt_EMPWORK_EEXP_TELEPHONE.GetBindingExpression(TextBox.TextProperty).UpdateSource(); HREmployeeWorkExperienceUI.txt_EMPWORK_EEXP_EMAIL.GetBindingExpression(TextBox.TextProperty).UpdateSource(); HREmployeeWorkExperienceUI.dpk_EMPWORK_EEXP_FROM_DATE.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); HREmployeeWorkExperienceUI.dpk_EMPWORK_EEXP_TO_DATE.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource(); //Checking if all controls are in valid state if (!Helper.IsValid(HREmployeeWorkExperienceUI.EMPWORKGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (HREmployeeWorkExperienceUI.BtnAdd.IsChecked == true) { if (!client.EMPWORKExists(EmployeeExpToSave)) { ApiAck ack = client.CreateEMPWORK(EmployeeExpToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateEMPWORK(EmployeeExpToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var SaveTrainingInformation = (HR_EMP_TRAININGS)CollectionViewSource.GetDefaultView(Training.TrainingGrid.DataContext).CurrentItem; //This is used incase a user never enters a textbox but still needs validating /*EmergencyContact.txt_FullName.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_Relationship.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_PermanentAddress.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_OfficialAddress.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_TelephoneHome.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_TelephoneMobile.GetBindingExpression(TextBox.TextProperty).UpdateSource(); * EmergencyContact.txt_TelephoneOffice.GetBindingExpression(TextBox.TextProperty).UpdateSource();*/ //Checking if all controls are in valid state if (!Helper.IsValid(Training.TrainingGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (Training.BtnAdd.IsChecked == true) { if (!client.ExistTraining(SaveTrainingInformation)) { ApiAck ack = client.CreateTraining(SaveTrainingInformation); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateTraining(SaveTrainingInformation); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
public void Save() { //Get an instance of the service using Helper class var client = Helper.getServiceClient(); try { //Get the current object in the EditGrid var LastLanguageInfoToSave = (HR_EMP_LANGUAGE)CollectionViewSource.GetDefaultView(language.HREmpLanguageGrid.DataContext).CurrentItem; LastLanguageInfoToSave.EMP_NUMBER = LastLanguageInfoToSave.HR_EMPLOYEE.EMP_NUMBER; LastLanguageInfoToSave.LANG_CODE = LastLanguageInfoToSave.HR_LANGUAGE.LANG_CODE; //This is used incase a user never enters a textbox but still needs validating language.EmpLanguageEmpIdDropDown.GetBindingExpression(CustomSearchDropDown.CustomSelectedItemProperty).UpdateSource(); language.EmpLanguageLangCodeDropDown.GetBindingExpression(CustomSearchDropDown.CustomSelectedItemProperty).UpdateSource(); //Checking if all controls are in valid state if (!Helper.IsValid(language.HREmpLanguageGrid)) { MessageBox.Show("Please fix errors before continuing", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } //A user is trying to add a record here if (language.BtnAdd.IsChecked == true) { var LanguageToSave = (LastLanguageInfoToSave); if (!client.HREmpLanguageExists(LanguageToSave)) { ApiAck ack = client.CreateHREmpLanguage(LanguageToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Added Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); //Complete the Add operation. i.e.; Re-enable tabs,textboxes and datagrid CompleteAdd(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } else { MessageBox.Show("Record Already Exists", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } //Else the user is trying to update a record else { ApiAck ack = client.UpdateHREmpLanguage(LastLanguageInfoToSave); if (ack.CallStatus == EApiCallStatus.Success) { MessageBox.Show("Record Updated Successfully", "Message", MessageBoxButton.OK, MessageBoxImage.Information); CompleteUpdate(); } else { MessageBox.Show(ack.ReturnedMessage, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } } } catch (NullReferenceException) { MessageBox.Show("Nothing to Update", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } catch (Exception ex) { MessageBox.Show(ex.Message, "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }