Пример #1
0
        public SupplierDialogFrm(Common.FormMode formMode, Data_Supplier supplier)
        {
            InitializeComponent();

            try {
                this.formMode = formMode;
                if (Global.HideSensitiveSupplierFields)
                {
                    HideSensitiveFields();
                }

                bsSupplierTypes.DataSource = Data_SupplierType.GetSupplierTypes();
                if (formMode == Common.FormMode.Add)
                {
                    supplierID = -1;
                    luSupplierType.SelectedIndex = -1;
                }
                else
                {
                    BindControls(supplier);

                    if (formMode == Common.FormMode.View)
                    {
                        Utils.DisableAllControls(this);
                        this.Text = String.Format("View Supplier {0} ({1})", supplier.SupplierID, supplier.Name);
                        return;
                    }

                    this.Text = String.Format("Edit Supplier {0} ({1})", supplier.SupplierID, supplier.Name);
                }
            } catch (Exception ex) {
                Utils.ShowException(ex);
            }
        }
Пример #2
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);
            }
        }
Пример #3
0
 private void GetRecords()
 {
     try
     {
         Cursor.Current       = Cursors.WaitCursor;
         bsRecords.DataSource = Data_SupplierType.GetSupplierTypes();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
 }
Пример #4
0
        public SupplierSelectDialogFrm(decimal amount = 0)
        {
            InitializeComponent();

            try
            {
                bsSupplierTypes.DataSource = Data_SupplierType.GetSupplierTypes();
                this.amount = amount;

                suppliers = Data_Supplier.GetSuppliersWithPaymentStagingCheck(Global.Username);
                bsSuppliers.DataSource = suppliers;

                luSupplierType.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                Utils.ShowException(ex);
            }
        }
Пример #5
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);
            }
        }