public PaymentsCtrl() { InitializeComponent(); try { bsSupplierTypes.DataSource = Data_SupplierType.GetSupplierTypes(); bsBankAccounts.DataSource = Data_BankAccount.GetBankAccounts(); txtReference.Text = Data_SystemParameters.GetPaymentRef(); String regAmount = Utils.GetRegistryValue("PaymentAmount") == null ? "0" : Utils.GetRegistryValue("PaymentAmount").ToString(); decimal amount; if (!Decimal.TryParse(regAmount, out amount)) { throw new Exception("Error retrieving Amount from Registry! Invalid decimal type."); } numAmount.Value = amount; GetRecords(); } catch (Exception ex) { Utils.ShowException(ex); } }
private void GetRecords() { try { Cursor.Current = Cursors.WaitCursor; bsRecords.DataSource = Data_BankAccount.GetBankAccounts(); } catch (Exception ex) { throw ex; } finally { Cursor.Current = Cursors.Default; } }
public PaymentEnquiryCtrl() { InitializeComponent(); try { bsSuppliers.DataSource = Data_Supplier.GetSuppliers(); bsSupplierTypes.DataSource = Data_SupplierType.GetSupplierTypes(); bsUsers.DataSource = Data_User.GetUsers(); bsBankAccounts.DataSource = Data_BankAccount.GetBankAccounts(); luSuppliers.SelectedIndex = -1; luSupplierTypes.SelectedIndex = -1; luUsers.SelectedIndex = -1; luBankAccount.SelectedIndex = -1; dtDateFrom.Value = DateTime.Parse(String.Format("01/01/{0}", DateTime.Now.Year)); dtDateTo.Value = DateTime.Now.Date; } catch (Exception ex) { Utils.ShowException(ex); } }