Beispiel #1
0
        private void btnPaymentList_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            Transaction.List.PaymentVouchersList frmList = new Transaction.List.PaymentVouchersList();
            frmList.StartPosition = FormStartPosition.CenterScreen;
            frmList.ShowDialog();

            FillPaymentVoucher();
        }
Beispiel #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            bool isDelete = objpaybl.DeletPaymentVoucher(Payid);

            if (isDelete)
            {
                MessageBox.Show("Delete Successfully!");
                Payid = 0;
                ClearFormValues();
                Transaction.List.PaymentVouchersList frmList = new Transaction.List.PaymentVouchersList();
                frmList.StartPosition = FormStartPosition.CenterScreen;
                frmList.ShowDialog();

                FillPaymentVoucher();
            }
        }
Beispiel #3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            bool isDelete = objRecBL.DeleteRecieptVoucher(Recpt_Id);

            if (isDelete)
            {
                MessageBox.Show("Delete Successfully!");
                ClearFormValues();
                Recpt_Id = 0;
                Transaction.List.PaymentVouchersList frmList = new Transaction.List.PaymentVouchersList();
                frmList.StartPosition = FormStartPosition.CenterScreen;

                frmList.ShowDialog();
                FillRecieptVoucherInfo();
            }
        }
Beispiel #4
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            PaymentVoucherModel objPayment = new PaymentVoucherModel();

            if (tbxVchNumber.Text.Trim() == "")
            {
                MessageBox.Show("Voucher Number Can Not Be Blank!");
                return;
            }
            objPayment.Voucher_Series = tbxVoucherSeries.Text.Trim();
            objPayment.Voucher_Number = Convert.ToInt32(tbxVchNumber.Text.Trim());
            objPayment.Pay_Date       = Convert.ToDateTime(dtDate.Text);
            objPayment.Type           = tbxType.Text.Trim() == null ? string.Empty : tbxType.Text.Trim();
            objPayment.PDCDate        = Convert.ToDateTime(dtPDCDate.Text);
            objPayment.PaymentModeId  = objAccBL.GetLedgerIdByAccountName(cbxPayMode.Text.Trim() == null?string.Empty:cbxPayMode.Text.Trim());
            objPayment.LongNarration  = tbxLongNarration.Text.Trim() == null ? string.Empty : tbxLongNarration.Text.Trim();
            if (objPayment.PaymentModeId == 0)
            {
                objPayment.TotalDebitAmt  = Convert.ToDecimal(colDebit.SummaryItem.SummaryValue);
                objPayment.TotalCreditAmt = Convert.ToDecimal(colCredit.SummaryItem.SummaryValue);
            }
            else
            {
                objPayment.TotalCreditAmt = Convert.ToDecimal(colAmount.SummaryItem.SummaryValue);
            }
            //Payment details
            AccountModel        objacc;
            List <AccountModel> lstAccounts = new List <AccountModel>();

            for (int i = 0; i < gdvPayment.DataRowCount; i++)
            {
                DataRow row = gdvPayment.GetDataRow(i);

                objacc          = new AccountModel();
                objacc.DC       = row["DC"].ToString();
                objacc.Account  = row["Account"].ToString();
                objacc.LedgerId = objAccBL.GetLedgerIdByAccountName(row["Account"].ToString());
                if (objPayment.PaymentModeId == 0)
                {
                    objacc.Debit  = Convert.ToDecimal(row["Debit"].ToString() == string.Empty ? "0.00" : row["Debit"].ToString());
                    objacc.Credit = Convert.ToDecimal(row["Credit"].ToString() == string.Empty ? "0.00" : row["Credit"].ToString());
                }
                else
                {
                    objacc.Debit = Convert.ToDecimal(row["Amount"].ToString() == string.Empty ? "0.00" : row["Amount"].ToString());
                }
                objacc.Narration = row["Narration"].ToString() == null ? string.Empty : row["Narration"].ToString();
                objacc.ParentId  = Convert.ToInt32(row["ParentId"].ToString() == string.Empty ? "0" : row["ParentId"]);
                objacc.AC_Id     = Convert.ToInt32(row["Ac_Id"].ToString() == string.Empty ? "0" : row["Ac_Id"]);
                lstAccounts.Add(objacc);
            }

            objPayment.PaymentAccountModel = lstAccounts;
            objPayment.Pay_Id = Payid;

            bool isSuccess = objpaybl.UpdatePaymentVoucher(objPayment);

            if (isSuccess)
            {
                MessageBox.Show("Update Successfully!");
                Payid = 0;
                ClearFormValues();
                Transaction.List.PaymentVouchersList frmList = new Transaction.List.PaymentVouchersList();
                frmList.StartPosition = FormStartPosition.CenterScreen;
                frmList.ShowDialog();

                FillPaymentVoucher();
            }
        }