private loan_type getLoanTypeData() { try { loan_type _loanType = new loan_type(); _loanType.ID = IDHandller.generateID("loan_type"); _loanType.LOAN_TYPE_ID = LoanTypeCodeTextBox.Text; _loanType.STATUS = true; _loanType.INSERT_USER_ID = Session.LoggedEmployee.ID; _loanType.INSERT_DATETIME = System.DateTime.Now; _loanType.AMOUNT = Convert.ToDecimal(LoanAmountTextBox.Text); _loanType.INSTALLMENT = Convert.ToDecimal(InstallmentTextBox.Text); _loanType.DAYS = Convert.ToInt32(DaysTextBox.Text); _loanType.FULLNAME = ShortNameTextBox.Text; _loanType.REMARK = RemarkTextBox.Text; return(_loanType); } catch { return(null); } }
private async void SelectButton_Click(object sender, RoutedEventArgs e) { Button button = (Button)sender; StackPanel sp = (StackPanel)button.Content; Label lbl = sp.Children.OfType <Label>().FirstOrDefault(); if (lbl.Content.ToString() != "") { if (getSearchType() == 1) { employee selected = SearchedListEmployee.Single(emp => emp.ID == lbl.Content.ToString()); IssueLoan.Instance.SelectedEmployee = selected; } else if (getSearchType() == 0) { customer selected = SearchedListCustomer.Single(emp => emp.ID == lbl.Content.ToString()); IssueLoan.Instance.SelectedCustomer = selected; } else if (getSearchType() == 2) { loan_type selected = SearchedListLoanType.Single(emp => emp.ID == lbl.Content.ToString()); IssueLoan.Instance.SelectedLoan_Type = selected; } } else { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Error", MessageDialogStyle.Affirmative); } }
private void clearData() { _selectedCustomer = null; _selectedEmployee = null; _selectedLoanType = null; _selectedLoan = null; }
private async void LoanSaveButton_Click(object sender, RoutedEventArgs e) { loan_type _loanType = getLoanTypeData(); if (LoanTypeService.InsertLoanType(_loanType) == 1) { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Loan Type Added Success!", MessageDialogStyle.Affirmative); clearLoanTypePage(); } else { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Please check Deatails", MessageDialogStyle.Affirmative); } }