private void LoadCombo()
        {
            cbxFixedDiscount.SelectedIndexChanged += CbxFixedDiscount_SelectedIndexChanged;

            //Fill half Scheme options
            cbxHalfScheme.DataSource   = Enum.GetValues(typeof(Enums.Choice));
            cbxHalfScheme.SelectedItem = Choice.No;

            //Fill qtr Scheme options
            cbxQtrScheme.DataSource   = Enum.GetValues(typeof(Enums.Choice));
            cbxQtrScheme.SelectedItem = Choice.No;

            //Fill fixed discount options
            cbxFixedDiscount.DataSource   = Enum.GetValues(typeof(Enums.Choice));
            cbxFixedDiscount.SelectedItem = Choice.No;

            //Fill status options
            cbxStatus.DataSource   = Enum.GetValues(typeof(Enums.Status));
            cbxStatus.SelectedItem = Status.Active;

            //Fill sale type list
            cbxSaleType.DataSource    = applicationFacade.GetAccountLedgerBySystemName("SaleLedger");
            cbxSaleType.DisplayMember = "AccountLedgerName";
            cbxSaleType.ValueMember   = "AccountLedgerID";

            //Fill purchase type list
            cbxPurchaseType.DataSource    = applicationFacade.GetAccountLedgerBySystemName("PurchaseLedger");
            cbxPurchaseType.DisplayMember = "AccountLedgerName";
            cbxPurchaseType.ValueMember   = "AccountLedgerID";
        }
        private void FillCombo()
        {
            ////Fill Credit/Debit options
            cbxCreditDebit.DataSource   = Enum.GetValues(typeof(Enums.TransType));
            cbxCreditDebit.SelectedItem = TransType.C;

            ////Fill Credit/Debit options
            cbxTaxRetail.DataSource   = Enum.GetValues(typeof(Enums.TaxRetail));
            cbxTaxRetail.SelectedItem = Enums.TaxRetail.R;

            ////Fill Status options
            cbxStatus.DataSource   = Enum.GetValues(typeof(Enums.Status));
            cbxStatus.SelectedItem = Enums.Status.Active;

            //Fill Purchase type option
            cbxPurchaseType.DataSource    = applicationFacade.GetAccountLedgerBySystemName("PurchaseLedger");
            cbxPurchaseType.DisplayMember = "AccountLedgerName";
            cbxPurchaseType.ValueMember   = "AccountLedgerID";
        }
Exemplo n.º 3
0
        private void FillFormForUpdate()
        {
            cbAccountLedgerType.SelectedIndexChanged -= CbAccountLedgerType_SelectedIndexChanged;

            cbxStatus.DataSource   = Enum.GetValues(typeof(Enums.Status));
            cbxStatus.SelectedItem = Enums.Status.Active;

            var accountLedgerMaster = applicationFacade.GetAccountLedgerById(this.AccountLedgerId);

            cbAccountLedgerType.DataSource    = accountLedgerMaster.AccountLedgerTypeList;
            cbAccountLedgerType.ValueMember   = "AccountLedgerTypeID";
            cbAccountLedgerType.DisplayMember = "AccountLedgerTypeName";

            cbAccountType.DataSource    = accountLedgerMaster.AccountTypeList;
            cbAccountType.ValueMember   = "AccountTypeID";
            cbAccountType.DisplayMember = "AccountTypeDisplayName";

            if (accountLedgerMaster.AccountLedgerTypeSystemName != Constants.AccountLedgerType.ControlCodes)
            {
                var debitControlCodes  = applicationFacade.GetAccountLedgerBySystemName(Constants.AccountLedgerType.ControlCodes);
                var creditControlCodes = applicationFacade.GetAccountLedgerBySystemName(Constants.AccountLedgerType.ControlCodes);

                cbDebitControlCode.DataSource  = debitControlCodes;
                cbCreditControlCode.DataSource = creditControlCodes;

                cbDebitControlCode.ValueMember   = "AccountLedgerID";
                cbDebitControlCode.DisplayMember = "AccountLedgerName";

                cbCreditControlCode.ValueMember   = "AccountLedgerID";
                cbCreditControlCode.DisplayMember = "AccountLedgerName";

                cbCreditControlCode.SelectedValue = accountLedgerMaster.CreditControlCodeID;
                cbDebitControlCode.SelectedValue  = accountLedgerMaster.DebitControlCodeID;

                gbBalanceSheet.Visible = true;
            }
            else
            {
                cbDebitControlCode.DataSource  = null;
                cbCreditControlCode.DataSource = null;
                gbBalanceSheet.Visible         = false;
            }

            cbAccountLedgerType.SelectedValue = accountLedgerMaster.AccountLedgerTypeId;
            cbDebitCredit.SelectedItem        = accountLedgerMaster.CreditDebit;
            cbxStatus.SelectedItem            = accountLedgerMaster.Status ? Enums.Status.Active : Enums.Status.Inactive;

            tbAccountName.Text        = accountLedgerMaster.AccountLedgerName;
            txtAccountLedgerCode.Text = accountLedgerMaster.AccountLedgerCode;
            tbOpeningBalance.Text     = Convert.ToString(accountLedgerMaster.OpeningBalance);
            txtSalePurchaseValue.Text = Convert.ToString(accountLedgerMaster.SalePurchaseTaxValue);

            cbAccountLedgerType.Enabled = false;

            if (accountLedgerMaster.AccountLedgerTypeSystemName == Constants.AccountLedgerType.SaleLedger ||
                accountLedgerMaster.AccountLedgerTypeSystemName == Constants.AccountLedgerType.PurchaseLedger)
            {
                txtSalePurchaseValue.Enabled = true;
            }
            else
            {
                txtSalePurchaseValue.Enabled = false;
                txtSalePurchaseValue.Text    = "0.00";
            }


            tbAccountName.Focus();
        }