protected void GetPaymentsByID(int PaymentID) { AccPaymentstbl Pa = new AccPaymentstbl { PaymentID = PaymentID }; List <AccPaymentstbl> lstPayments = new List <AccPaymentstbl>(); lstPayments = objpayBL.GetPaymentsbyId(Pa).ToList(); // 1- cash, 2 - Bank foreach (var el in lstPayments) { hdnPaymentsID.Value = el.PaymentID.ToString(); //lblAgainstPurchase.Text= el.PaymentType; //if (Convert.ToInt32(el.PaymentType) == 1) //{ // el.PaymentType = "Against Purchase"; //} //else if (Convert.ToInt32(el.PaymentType) == 2) //{ // el.PaymentType = "Advance Payment"; //} //else if (Convert.ToInt32(el.PaymentType) == 3) //{ // el.PaymentType = "Other Payment"; //} lblVNo.Text = el.VoucherNo; lblMaAcc.Text = GetMajorAccounts(Convert.ToInt32(el.MajorAccount)); lblMiAcc.Text = GetMinorAccounts(Convert.ToInt32(el.MinorAccount)); lblPDate.Text = Convert.ToDateTime(el.PaymentDate).ToShortDateString(); lblTAccount.Text = GetSuppliers(Convert.ToInt32(el.ToAccount)); if (Convert.ToInt32(el.PaymentThrough) == 1) { lblPayThrough.Text = "Cash"; lblChequeNo.Visible = false; lblCNo.Visible = false; lblChequeDate.Visible = false; lblCDate.Visible = false; lblDDNo.Visible = false; lblDDN.Visible = false; lblDDDate.Visible = false; lblDDD.Visible = false; lblAcnt.Visible = false; lblAcunt.Visible = false; lblBankName.Visible = false; lblBName.Visible = false; lblCardNo.Visible = false; lblCrdN.Visible = false; lblTDate.Visible = false; lblTD.Visible = false; lblRNo.Visible = false; lblRefNo.Visible = false; lblPaymentMode.Visible = false; lblPaymMode.Visible = false; if (Convert.ToInt32(el.FromAccount) == 1) { lblFAccount.Text = "Cash in hand"; } divPM.Visible = false; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; } // Bank else if (Convert.ToInt32(el.PaymentThrough) == 2) { divPM.Visible = true; lblPayThrough.Text = "Bank"; lblFAccount.Text = GetBank(Convert.ToInt32(el.FromAccount)); // Cheque if (Convert.ToInt32(el.PaymentMode) == 1) { divPM.Visible = true; divCheque.Visible = true; divDD.Visible = false; divBank.Visible = true; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; lblPaymMode.Text = "Cheque"; lblDDNo.Visible = false; lblDDN.Visible = false; lblDDDate.Visible = false; lblDDD.Visible = false; lblCardNo.Visible = false; lblCrdN.Visible = false; lblTDate.Visible = false; lblTD.Visible = false; lblRNo.Visible = false; lblRefNo.Visible = false; lblCNo.Text = el.CdNo.ToString(); lblCDate.Text = Convert.ToDateTime(el.CdDate).ToShortDateString(); } // DD else if (Convert.ToInt32(el.PaymentMode) == 2) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = true; divBank.Visible = true; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; lblPaymMode.Text = "DD"; lblChequeNo.Visible = false; lblCNo.Visible = false; lblChequeDate.Visible = false; lblCDate.Visible = false; lblCardNo.Visible = false; lblCrdN.Visible = false; lblTDate.Visible = false; lblTD.Visible = false; lblRNo.Visible = false; lblRefNo.Visible = false; lblDDN.Text = el.CdNo.ToString(); lblDDD.Text = Convert.ToDateTime(el.CdDate).ToShortDateString(); } // Credit/ Debit Card else if (Convert.ToInt32(el.PaymentMode) == 3) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = true; divTD.Visible = true; divRN.Visible = true; lblPaymMode.Text = "Credit/Debit card"; lblChequeNo.Visible = false; lblCNo.Visible = false; lblChequeDate.Visible = false; lblCDate.Visible = false; lblDDNo.Visible = false; lblDDN.Visible = false; lblDDDate.Visible = false; lblDDD.Visible = false; lblAcnt.Visible = false; lblAcunt.Visible = false; lblBankName.Visible = false; lblBName.Visible = false; } // Internet Banking else if (Convert.ToInt32(el.PaymentMode) == 4) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = false; divTD.Visible = true; divRN.Visible = true; lblPaymMode.Text = "InternetBanking"; lblChequeNo.Visible = false; lblCNo.Visible = false; lblChequeDate.Visible = false; lblCDate.Visible = false; lblDDNo.Visible = false; lblDDN.Visible = false; lblDDDate.Visible = false; lblDDD.Visible = false; lblAcnt.Visible = false; lblAcunt.Visible = false; lblBankName.Visible = false; lblBName.Visible = false; lblCardNo.Visible = false; lblCrdN.Visible = false; } } //lblPayM.Text = el.PaymentMode; //lblA.Text = el.Accounts; lblCurrentBal.Text = el.CurrentBalance; lblPayingAmt.Text = el.PayingAmount; //lblPM.Text = el.PayMode; lblAcunt.Text = el.AcNo; lblBName.Text = el.BankName; lblCrdN.Text = el.CardNo; lblTD.Text = el.TransactionDate == "" ? "" : Convert.ToDateTime(el.TransactionDate).ToShortDateString(); lblRefNo.Text = el.ReferenceNo; lblNrtn.Text = el.Narration; lblFN.Text = el.AttachFiles; LiteralControl lc = new LiteralControl(); lc.Text = "<a href='../Files/Payments/" + el.AttachFiles + "' class='btn btn-success btn-file' download><i class='fa fa-download'></i></a>"; PlaceHolder1.Controls.Add(lc); } }
protected void BtnUpdate_Click(object sender, EventArgs e) { AccPaymentstbl Pa = new AccPaymentstbl(); Pa.PaymentID = Convert.ToInt32(hdnPaymentsID.Value); //Pa.PaymentType = ddlPaymentType.SelectedValue; Pa.VoucherNo = txtVoucherNumber.Text; Pa.MajorAccount = ddlMAccountList.SelectedValue; Pa.MinorAccount = ddlMinorAccountList.SelectedValue; Pa.PaymentDate = Convert.ToDateTime(txtPaymentDate.Text).ToString("yyyy-MM-dd"); 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 = Convert.ToDateTime(txtChequeDate.Text).ToString("yyyy-MM-dd"); Pa.AcNo = txtAcNo.Text; Pa.BankName = txtBankName.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 2) { Pa.CdNo = txtDDNo.Text; Pa.CdDate = Convert.ToDateTime(txtDDDate.Text).ToString("yyyy-MM-dd"); Pa.AcNo = txtAcNo.Text; Pa.BankName = txtBankName.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 3) { Pa.CardNo = txtCardNo.Text; Pa.TransactionDate = Convert.ToDateTime(txtTransactionDate.Text).ToString("yyyy-MM-dd"); Pa.ReferenceNo = txtReferenceNo.Text; } else if (Convert.ToInt32(ddlPaymentMode.SelectedValue) == 4) { Pa.TransactionDate = Convert.ToDateTime(txtTransactionDate.Text).ToString("yyyy-MM-dd"); Pa.ReferenceNo = txtReferenceNo.Text; } //Pa.CdNo = Convert.ToInt32(txtChequeNo.Text); //Pa.CdDate = txtChequeDate.Text; //Pa.CdNo = Convert.ToInt32(txtDDNo.Text); //Pa.CdDate = txtDDDate.Text; //Pa.AcNo = txtAcNo.Text; ////Pa.BankName = txtBankName.Text; //Pa.CardNo = txtCardNo.Text; //Pa.TransactionDate = txtTransactionDate.Text; //Pa.ReferenceNo = txtReferenceNo.Text; //Pa.Comment = txtComments.Text; Pa.Narration = txtNarration.Text; Pa.AttachFiles = BrowseFile.FileName; List <AccPaymentstbl> lst = new List <AccPaymentstbl>(); Pa.Status = 1; Pa.UpdatedBy = 1; Pa.UpdatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); objAccPaymentsBL.UpdatePayments(Pa).ToList(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('Payments Updated Successfully');", true); Clear(); //UploadFile(); if (BrowseFile.HasFile == false) { } else { UploadFile(); } }
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(); }
public IEnumerable <AccPaymentstbl> GetPaymentsByStatus(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(8, pa)); }
protected void GetPaymentsbyId(int PaymentID) { AccPaymentstbl Pa = new AccPaymentstbl { PaymentID = PaymentID }; List <AccPaymentstbl> lstPayments = new List <AccPaymentstbl>(); lstPayments = objAccPaymentsBL.GetPaymentsbyId(Pa).ToList(); foreach (var el in lstPayments) { hdnPaymentsID.Value = el.PaymentID.ToString(); //ddlPaymentType.SelectedValue = el.PaymentType; txtVoucherNumber.Text = el.VoucherNo; GetMajorAccounts(Convert.ToInt32(el.MajorAccount)); ddlMAccountList.SelectedValue = el.MajorAccount; GetMinorAccounts(Convert.ToInt32(el.MinorAccount)); ddlMinorAccountList.SelectedValue = el.MinorAccount; txtPaymentDate.Text = Convert.ToDateTime(el.PaymentDate).ToShortDateString(); GetSuppliers(Convert.ToInt32(el.ToAccount)); ddlToAccount.SelectedValue = el.ToAccount; //ddlPaymentMode.SelectedValue = el.PaymentMode; //ddlAccount.SelectedValue = el.Accounts; // Cash if (Convert.ToInt32(el.PaymentThrough) == 1) { divPM.Visible = false; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; ddlPaymentThrough.SelectedValue = 1.ToString(); lblChequeNo.Visible = false; txtChequeNo.Visible = false; lblChequeDate.Visible = false; txtChequeDate.Visible = false; lblDDNo.Visible = false; txtDDNo.Visible = false; lblDDDate.Visible = false; txtDDDate.Visible = false; lblAcNO.Visible = false; txtAcNo.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; lblPaymentMode.Visible = false; ddlPaymentMode.Visible = false; ddlFromAccount.Items.Clear(); ddlFromAccount.Items.Add(new ListItem("--Select--")); ddlFromAccount.Items.Add(new ListItem("Cash in hand", "1")); ddlFromAccount.SelectedValue = 1.ToString(); } // Bank else if (Convert.ToInt32(el.PaymentThrough) == 2) { divPM.Visible = true; ddlPaymentThrough.SelectedValue = 2.ToString(); ddlFromAccount.Items.Clear(); //ddlAccount.Items.Add(new ListItem("--Select--")); //ddlAccount.Items.Add(new ListItem("Axis Bank", "1")); //ddlAccount.Items.Add(new ListItem("SBI Bank", "2")); GetBank(); ddlFromAccount.SelectedValue = el.FromAccount; // Cheque if (Convert.ToInt32(el.PaymentMode) == 1) { divPM.Visible = true; divCheque.Visible = true; divDD.Visible = false; divBank.Visible = true; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; lblDDNo.Visible = false; txtDDNo.Visible = false; lblDDDate.Visible = false; txtDDDate.Visible = false; lblCardNo.Visible = false; txtCardNo.Visible = false; lblTransactionDate.Visible = false; txtTransactionDate.Visible = false; lblReferenceNo.Visible = false; txtReferenceNo.Visible = false; txtChequeNo.Text = el.CdNo; txtChequeDate.Text = Convert.ToDateTime(el.CdDate).ToShortDateString(); } // DD else if (Convert.ToInt32(el.PaymentMode) == 2) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = true; divBank.Visible = true; divCard.Visible = false; divTD.Visible = false; divRN.Visible = false; lblChequeNo.Visible = false; txtChequeNo.Visible = false; lblChequeDate.Visible = false; txtChequeDate.Visible = false; lblCardNo.Visible = false; txtCardNo.Visible = false; lblTransactionDate.Visible = false; txtTransactionDate.Visible = false; lblReferenceNo.Visible = false; txtReferenceNo.Visible = false; txtDDNo.Text = el.CdNo; txtDDDate.Text = Convert.ToDateTime(el.CdDate).ToShortDateString(); } // Credit/ Debit Card else if (Convert.ToInt32(el.PaymentMode) == 3) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = true; divTD.Visible = true; divRN.Visible = true; lblChequeNo.Visible = false; txtChequeNo.Visible = false; lblChequeDate.Visible = false; txtChequeDate.Visible = false; lblDDNo.Visible = false; txtDDNo.Visible = false; lblDDDate.Visible = false; txtDDDate.Visible = false; lblAcNO.Visible = false; txtAcNo.Visible = false; lblBankName.Visible = false; txtBankName.Visible = false; } // Internet Banking else if (Convert.ToInt32(el.PaymentMode) == 4) { divPM.Visible = true; divCheque.Visible = false; divDD.Visible = false; divBank.Visible = false; divCard.Visible = false; divTD.Visible = true; divRN.Visible = true; lblChequeNo.Visible = false; txtChequeNo.Visible = false; lblChequeDate.Visible = false; txtChequeDate.Visible = false; lblDDNo.Visible = false; txtDDNo.Visible = false; lblDDDate.Visible = false; txtDDDate.Visible = false; lblAcNO.Visible = false; txtAcNo.Visible = false; lblBankName.Visible = false; txtBankName.Visible = false; lblCardNo.Visible = false; txtCardNo.Visible = false; } } txtCurrentBal.Text = el.CurrentBalance; txtPayingAmount.Text = el.PayingAmount; ddlPaymentMode.SelectedValue = el.PaymentMode; txtAcNo.Text = el.AcNo; txtBankName.Text = el.BankName; txtCardNo.Text = el.CardNo; txtTransactionDate.Text = el.TransactionDate == "" ? "" : Convert.ToDateTime(el.TransactionDate).ToShortDateString(); txtReferenceNo.Text = el.ReferenceNo; txtNarration.Text = el.Narration; lblChooseF.Text = el.AttachFiles; } }
public IEnumerable <AccPaymentstbl> UpdatePaymentsIsActive(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(6, pa)); }
public IEnumerable <AccPaymentstbl> UpdatePaymentsStatus(AccPaymentstbl ls) { return(objPaymentsDA.PaymentsAll(7, ls)); }
public IEnumerable <AccPaymentstbl> DeletePayments(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(5, pa)); }
public IEnumerable <AccPaymentstbl> UpdatePayments(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(4, pa)); }
public IEnumerable <AccPaymentstbl> InsertPayments(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(3, pa)); }
public IEnumerable <AccPaymentstbl> GetPaymentsbyId(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(2, pa)); }
public IEnumerable <AccPaymentstbl> GetAllPayments(AccPaymentstbl pa) { return(objPaymentsDA.PaymentsAll(1, pa)); }