Esempio n. 1
0
        private void LoadVoucher(int VoucherMasterId)
        {
            try
            {
                DataSet dsVocuher = VM.GetVoucherStructure(VoucherMasterId);
                dsVocuher.Tables[0].TableName = "VoucherMaster";
                dsVocuher.Tables[1].TableName = "VoucherDetail";
                dsVocuher.Tables[2].TableName = "FlagDC";
                dsVocuher.Tables[3].TableName = "ChartOfAccount";

                if (dsVocuher.Tables["VoucherMaster"].Rows.Count > 0)
                {
                    dtpVoucher.Text  = dsVocuher.Tables["VoucherMaster"].Rows[0]["Date"].ToString();
                    txtNaration.Text = dsVocuher.Tables["VoucherMaster"].Rows[0]["Narration"].ToString();
                    txtAmount.Text   = dsVocuher.Tables["VoucherMaster"].Rows[0]["TotalDebit"].ToString();

                    DataRow drDebit = dsVocuher.Tables["VoucherDetail"].Select("FlagDC = 'D'")[0];
                    txtCustomerCode.Text = drDebit["CustomerCode"].ToString();
                    txtAccCode.Text      = drDebit["AccountCode"].ToString();

                    DataRow drCredit = dsVocuher.Tables["VoucherDetail"].Select("FlagDC = 'C'")[0];
                    txtBankAcc.Text = drCredit["AccountCode"].ToString();
                    //txtBankAccountCode

                    //txtRemarks.Text = drCredit["Remarks"].ToString();
                    DataTable dtVoucherDetail = manageBank.GetBankVoucherDetailByVoucherMasterId(VoucherMasterId);
                    if (dtVoucherDetail.Rows.Count > 0)
                    {
                        try
                        {
                            BankVoucherDetailId         = Convert.ToInt32(dtVoucherDetail.Rows[0]["BankVoucherDetailId"]);
                            BankACId                    = Convert.ToInt32(dtVoucherDetail.Rows[0]["BankAccountId"]);
                            txtBankAccountCode.Text     = manageBank.GetBankAccount(BankACId).Rows[0]["Code"].ToString();
                            txtChequeNumber.Text        = dtVoucherDetail.Rows[0]["ChequeNumber"].ToString();
                            cmbChequeBank.SelectedValue = dtVoucherDetail.Rows[0]["ChequeBankId"].ToString();
                            dtpCheque.Value             = Convert.ToDateTime(dtVoucherDetail.Rows[0]["ChequeDate"]);
                        }
                        catch (Exception ex)
                        {
                        }
                    }

                    ButtonRights(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        private void LoadBankAccount(int BACId)
        {
            DataTable dtBankAC = manageBank.GetBankAccount(BACId);;

            if (dtBankAC.Rows.Count > 0)
            {
                txtBranchCode.Text        = dtBankAC.Rows[0]["BranchCode"].ToString();
                txtACNumber.Text          = dtBankAC.Rows[0]["AccountNo"].ToString();
                txtACTitle.Text           = dtBankAC.Rows[0]["AccountTitle"].ToString();
                cmbBankName.SelectedValue = dtBankAC.Rows[0]["BankId"].ToString();
                txtCOACode.Text           = manageAccount.GetChartOfAccounts(Convert.ToInt32(dtBankAC.Rows[0]["COAId"])).Rows[0]["AccountCode"].ToString();
                txtBranchCode.Focus();
                ButtonRights(false);
            }
        }
Esempio n. 3
0
        private void LoadBankAccount(int BankACId)
        {
            BankManager manageBank    = new BankManager();
            DataTable   dtBankAccount = manageBank.GetBankAccount(BankACId);

            if (dtBankAccount.Rows.Count > 0)
            {
                txtBACTitle.Text = dtBankAccount.Rows[0]["AccountTitle"].ToString();
                if (!string.IsNullOrEmpty(dtBankAccount.Rows[0]["COAId"].ToString()))
                {
                    txtBankAcc.Text = manageAccount.GetChartOfAccounts(Convert.ToInt32(dtBankAccount.Rows[0]["COAId"])).Rows[0]["AccountCode"].ToString();
                }
                BankId = Convert.ToInt32(dtBankAccount.Rows[0]["BankId"]);
            }
        }