protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            SuppliersBL objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            if (!IsPostBack)
            {
                if (Session["PaymentID"].ToString() != null)
                {
                    int PaymentID = Convert.ToInt32(Session["PaymentID"]);
                    GetPaymentsByID(PaymentID);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            AgentsBL objAgentsBL = new AgentsBL();

            lstAgents = objAgentsBL.GetAllAgents(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            //divPM.Visible = false;
            //divCheque.Visible = false;
            //divDD.Visible = false;
            //divBank.Visible = false;
            //divCard.Visible = false;
            //divTD.Visible = false;
            //divRN.Visible = false;

            if (!IsPostBack)
            {
                if (Session["ReceiptID"].ToString() != null)
                {
                    int ReceiptID = Convert.ToInt32(Session["ReceiptID"]);
                    GetAccReceiptById(ReceiptID);
                }
            }
        }
        protected string GetMinorAccounts(int maid)
        {
            List <MinorAccounttbl> lstMinor          = new List <MinorAccounttbl>();
            MinorAccounttbl        Mn                = new MinorAccounttbl();
            MinorAccountBL         objMinorAccountBL = new MinorAccountBL();

            Mn.Status = 1;
            lstMinor  = objMinorAccountBL.GetMinorAccountByStatus(Mn).ToList();
            ListItem mn = new ListItem();

            mn.Text  = "--Select--";
            mn.Value = 0.ToString();
            ddlMinorAccountList.Items.Add(mn);
            foreach (var nt in lstMinor)
            {
                ListItem lc = new ListItem();
                lc.Text  = nt.MinorAccountName;
                lc.Value = nt.MinorAccountID.ToString();
                ddlMinorAccountList.Items.Add(lc);
            }
            var minor = lstMinor.OfType <MinorAccounttbl>().Where(a => a.MinorAccountID == maid);

            //return minor.First().MinorAccountName;
            return(minor.Count() > 0 ? minor.First().MinorAccountName : "");
        }
        protected string GetMinorAccounts(int maid)
        {
            List <MinorAccounttbl> lstMinor          = new List <MinorAccounttbl>();
            MinorAccounttbl        Mn                = new MinorAccounttbl();
            MinorAccountBL         objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(Mn).ToList();
            var minor = lstMinor.OfType <MinorAccounttbl>().Where(d => d.MinorAccountID == maid);

            //return minor.First().MinorAccountName;
            return(minor.Count() > 0 ? minor.First().MinorAccountName : "");
        }
        protected void ddlMinorAccountList_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <MinorAccounttbl> lstMinor          = new List <MinorAccounttbl>();
            MinorAccounttbl        Mn                = new MinorAccounttbl();
            MinorAccountBL         objMinorAccountBL = new MinorAccountBL();

            Mn.Status         = 1;
            Mn.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue);
            lstMinor          = objMinorAccountBL.GetMinorAccountById(Mn).ToList();

            txtCurrentBal.Text = lstMinor[0].Amount.ToString();
        }
        protected void GetMinorAccounts()
        {
            List <MinorAccounttbl> lstMinor          = new List <MinorAccounttbl>();
            MinorAccounttbl        Mn                = new MinorAccounttbl();
            MinorAccountBL         objMinorAccountBL = new MinorAccountBL();

            Mn.Status = 1;
            lstMinor  = objMinorAccountBL.MajorAccountIDByStatus(Mn).ToList();
            ListItem mn = new ListItem();

            mn.Text  = "--Select--";
            mn.Value = 0.ToString();
            ddlMinorAccountList.Items.Add(mn);
            foreach (var nt in lstMinor)
            {
                ListItem lc = new ListItem();
                lc.Text  = nt.MinorAccountName;
                lc.Value = nt.MinorAccountID.ToString();
                ddlMinorAccountList.Items.Add(lc);
            }
        }
        protected void ddlMAccountList_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <MinorAccounttbl> lstMinor          = new List <MinorAccounttbl>();
            MinorAccounttbl        Mn                = new MinorAccounttbl();
            MinorAccountBL         objMinorAccountBL = new MinorAccountBL();

            Mn.Status         = 1;
            Mn.MajorAccountID = Convert.ToInt32(ddlMAccountList.SelectedValue);
            lstMinor          = objMinorAccountBL.MajorAccountIDByStatus(Mn).ToList();
            ddlMinorAccountList.Items.Clear();
            ListItem mn = new ListItem();

            mn.Text  = "--Select--";
            mn.Value = 0.ToString();
            ddlMinorAccountList.Items.Add(mn);
            foreach (var nt in lstMinor)
            {
                ListItem lc = new ListItem();
                lc.Text = nt.MinorAccountName;
                //lc.Text = nt..ToString();
                lc.Value = nt.MinorAccountID.ToString();
                ddlMinorAccountList.Items.Add(lc);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            SuppliersBL objSuppliersBL = new SuppliersBL();

            lstSuppliers = objSuppliersBL.GetAllSuppliers(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            if (!IsPostBack)
            {
                divPM.Visible     = false;
                divCheque.Visible = false;
                divDD.Visible     = false;
                divBank.Visible   = false;
                divCard.Visible   = false;
                divTD.Visible     = false;
                divRN.Visible     = false;

                //divCheque.Attributes.Remove("class");
                //divDD.Attributes.Remove("class");
                //divBank.Attributes.Remove("class");
                //divCard.Attributes.Remove("class");
                //divTD.Attributes.Remove("class");
                //divRN.Attributes.Remove("class");

                lblPaymentMode.Visible     = false;
                ddlPaymentMode.Visible     = false;
                lblChequeNo.Visible        = false;
                txtChequeNo.Visible        = false;
                lblChequeDate.Visible      = false;
                txtChequeDate.Visible      = false;
                lblAcNO.Visible            = false;
                txtAcNo.Visible            = false;
                lblDDNo.Visible            = false;
                txtDDNo.Visible            = false;
                lblDDDate.Visible          = false;
                txtDDDate.Visible          = false;
                lblBankName.Visible        = false;
                txtBankName.Visible        = false;
                lblCardNo.Visible          = false;
                txtCardNo.Visible          = false;
                lblTransactionDate.Visible = false;
                txtTransactionDate.Visible = false;
                lblReferenceNo.Visible     = false;
                txtReferenceNo.Visible     = false;
                Random rnd = new Random();
                int    num = rnd.Next(10000);
                txtVoucherNumber.Text = "MFB" + num;

                GetSuppliers();
                GetMajorAccounts();
                GetMinorAccounts();
            }
        }
        protected void InsertPayments()
        {
            AccPaymentstbl pa = new AccPaymentstbl();
            {
                //pa.PaymentType = ddlPaymentType.SelectedValue;
                pa.VoucherNo      = txtVoucherNumber.Text;
                pa.MajorAccount   = ddlMAccountList.Text;
                pa.MinorAccount   = ddlMinorAccountList.Text;
                pa.PaymentDate    = txtPaymentDate.Text;
                pa.ToAccount      = ddlToAccount.SelectedValue;
                pa.PaymentThrough = ddlPaymentThrough.SelectedValue;
                pa.FromAccount    = ddlFromAccount.SelectedValue;
                pa.CurrentBalance = txtCurrentBal.Text;
                pa.PayingAmount   = txtPayingAmount.Text;
                pa.PaymentMode    = ddlPaymentMode.SelectedValue;
                if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 1)
                {
                    pa.CdNo     = txtChequeNo.Text;
                    pa.CdDate   = txtChequeDate.Text;
                    pa.AcNo     = txtAcNo.Text;
                    pa.BankName = txtBankName.Text;
                }
                else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 2)
                {
                    pa.CdNo     = txtDDNo.Text;
                    pa.CdDate   = txtDDDate.Text;
                    pa.AcNo     = txtAcNo.Text;
                    pa.BankName = txtBankName.Text;
                }
                else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 3)
                {
                    pa.CardNo          = txtCardNo.Text;
                    pa.TransactionDate = txtTransactionDate.Text;
                    pa.ReferenceNo     = txtReferenceNo.Text;
                }
                else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 4)
                {
                    pa.TransactionDate = txtTransactionDate.Text;
                    pa.ReferenceNo     = txtReferenceNo.Text;
                }
                pa.Narration   = txtNarration.Text;
                pa.AttachFiles = BrowseFile.FileName;
                pa.Status      = 1;
                pa.CreatedBy   = 1;
                pa.CreatedDate = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss");
            }

            MinorAccountBL  objMinorAccountBL = new MinorAccountBL();
            MinorAccounttbl mt = new MinorAccounttbl();

            mt.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue);
            mt.Amount         = string.IsNullOrEmpty(txtTotalBalance.Text) ? 0 : Convert.ToInt32(txtTotalBalance.Text);

            List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>();

            lstMinor = objMinorAccountBL.UpdateMinorAccountAmount(mt).ToList();

            List <AccPaymentstbl> lst = new List <AccPaymentstbl>();

            lst = objPaymentstBL.InsertPayments(pa).ToList();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Payments Saved Successfully');", true);
            btnSave.Visible = true;
            Reset();
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BankBL objBankBL = new BankBL();

            lstBank = objBankBL.GetAllBanks(cnt).ToList();

            AgentsBL objAgentsBL = new AgentsBL();

            lstAgents = objAgentsBL.GetAllAgents(cntt).ToList();

            MajorAccountBL objMajorAccountBL = new MajorAccountBL();

            lstMajor = objMajorAccountBL.GetAllAccounts(mt).ToList();

            MinorAccountBL objMinorAccountBL = new MinorAccountBL();

            lstMinor = objMinorAccountBL.GetAllMinorAccount(nt).ToList();

            //divPM.Visible = false;
            //divCheque.Visible = false;
            //divDD.Visible = false;
            //divBank.Visible = false;
            //divCard.Visible = false;
            //divTD.Visible = false;
            //divRN.Visible = false;

            if (!IsPostBack)
            {
                divPM.Visible     = false;
                divCheque.Visible = false;
                divDD.Visible     = false;
                divBank.Visible   = false;
                divCard.Visible   = false;
                divTD.Visible     = false;
                divRN.Visible     = false;

                lblChequeNo.Visible        = false;
                txtChequeNo.Visible        = false;
                lblChequeDate.Visible      = false;
                txtChequeDate.Visible      = false;
                lblDDNo.Visible            = false;
                txtDDNo.Visible            = false;
                lblDate.Visible            = false;
                txtDate.Visible            = false;
                lblAccountNo.Visible       = false;
                txtAccountNo.Visible       = false;
                lblBankName.Visible        = false;
                txtBankName.Visible        = false;
                lblCardNo.Visible          = false;
                txtCardNo.Visible          = false;
                lblTransactionDate.Visible = false;
                txtTransactionDate.Visible = false;
                lblReferenceNo.Visible     = false;
                txtReferenceNo.Visible     = false;
                Random rnd = new Random();
                int    num = rnd.Next(10000);
                txtVoucherNo.Text = "MFB" + num;

                GetAgents();
                GetMajorAccounts();
                GetMinorAccounts();
            }
        }
Example #11
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            AccReceiptstbl ls = new AccReceiptstbl
                                //MinorAccounttbl MA = new MinorAccounttbl;

            {
                VoucherNo       = txtVoucherNo.Text,
                MajorAccount    = ddlMAccountList.Text,
                MinorAccount    = ddlMinorAccountList.Text,
                ReceiveDate     = txtReceiveDate.Text,
                FromAccount     = DdlFromAccount.Text,
                ReceivedThrough = DdlReceivedThrough.Text,
                ToAccount       = DdlToAccount.Text,
                CurrentBalance  = txtCurrentBalance.Text,
                ReceivingAmount = txtReceivingAmount.Text,
                PaymentMode     = DdlPaymentMode.Text,
                //Comment = txtCommentsReason.Text,
                Narration       = txtNarration.Text,
                AttachFiles     = UploadDoc.FileName,
                ChequeNo        = string.IsNullOrEmpty(txtChequeNo.Text) ? 0 : Convert.ToInt32(txtChequeNo.Text),
                ChequeDate      = txtChequeDate.Text,
                DDNO            = string.IsNullOrEmpty(txtDDNo.Text) ? 0 : Convert.ToInt32(txtDDNo.Text),
                Date            = txtDate.Text,
                AccountNO       = txtAccountNo.Text,
                BankName        = txtBankName.Text,
                CardNo          = txtCardNo.Text,
                TransactionDate = txtTransactionDate.Text,
                ReferenceNo     = txtReferenceNo.Text,
                Status          = 1,
                CreatedBy       = 1,
                CreatedDate     = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss")
            };

            //AccReceiptInVoicestbl lv = new AccReceiptInVoicestbl
            //{

            //    Status = 1,
            //    CreatedBy = 1,
            //    CreatedDate = DateTime.Now.ToString(" yyyy-MM-dd HH:mm:ss")
            //};

            List <AccReceiptstbl> lst = new List <AccReceiptstbl>();

            lst = objAccReceiptsBL.SaveAccReceipt(ls).ToList();

            MinorAccountBL  objMinorAccountBL = new MinorAccountBL();
            MinorAccounttbl mt = new MinorAccounttbl();

            mt.MinorAccountID = Convert.ToInt32(ddlMinorAccountList.SelectedValue);
            mt.Amount         = string.IsNullOrEmpty(txtABalance.Text) ? 0 : Convert.ToInt32(txtABalance.Text);

            List <MinorAccounttbl> lstMinor = new List <MinorAccounttbl>();

            lstMinor = objMinorAccountBL.UpdateMinorAccountAmount(mt).ToList();

            //List<AccReceiptInVoicestbl> lstIV = new List<AccReceiptInVoicestbl>();
            //lstIV = objAccReceiptsInVoicesBL.SaveAccReceiptInVoices(lv).ToList();

            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('AccountReciept Saved Successfully');", true);
            Clear();
            //UploadFile();
            if (UploadDoc.HasFile == false)
            {
            }
            else
            {
                UploadFile();
            }
        }