예제 #1
0
        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);
            }
        }
예제 #2
0
 private void GetRecords()
 {
     try
     {
         Cursor.Current       = Cursors.WaitCursor;
         bsRecords.DataSource = Data_BankAccount.GetBankAccounts();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
예제 #3
0
        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);
            }
        }