private void LoadConsolidatedOutstandingList()
        {
            int      StateId    = Convert.ToInt32(ddlState.SelectedValue.Trim());
            int      DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue.Trim());
            int      BlockId    = Convert.ToInt32(ddlBlock.SelectedValue.Trim());
            int      CategoryId = Convert.ToInt32(ddlMembershipCategory.SelectedValue.Trim());
            DateTime ToDate     = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            DateTime FromDate   = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            //string MemberName = txtMemberName.Text.Trim();
            string MemberName     = "";
            int    BusinessTypeId = Convert.ToInt32(ddlBusinessType.SelectedValue); //14/10/19-business type fieldfor search
            int    ReportType     = Convert.ToInt32(ddlReportType.SelectedValue.Trim());

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataSet ds = objMemberPayment.GetOutstandingReportConsolidated(StateId, DistrictId, BlockId, CategoryId, ToDate, FromDate, MemberName, "", "", BusinessTypeId, ReportType);

            dgvMemberOutstanding.DataSource = ds.Tables[0];
            dgvMemberOutstanding.DataBind();

            Label1.Text = ds.Tables[1].Rows[0]["GrandTotal"].ToString();
            if (ds.Tables[0].Rows.Count > 0)
            {
                btnDownload.Visible  = true;
                btnSendEmail.Visible = true;
                Label1.Text          = "Grand Total : ";
                Label2.Text          = ds.Tables[1].Rows[0]["GrandTotal"].ToString();
            }
            else
            {
                btnDownload.Visible  = false;
                btnSendEmail.Visible = false;
                Label1.Text          = "Grand Total : ";
                Label2.Text          = "0.00";
            }
        }
Ejemplo n.º 2
0
        private void LoadPaymentList()
        {
            string   PaymentNo        = txtPaymentNo.Text.Trim();
            string   PaymentMode      = ddlPaymentMode.SelectedValue;
            int      CashBankLedgerId = Convert.ToInt32(ddlCashBankLedger.SelectedValue);
            int      MemberId         = Convert.ToInt32(ddlMember.SelectedValue);
            DateTime FromDate         = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            DateTime ToDate           = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = objMemberPayment.GetDevelopmentFeesPaymentReport(PaymentNo, CashBankLedgerId, PaymentMode, FromDate, ToDate, MemberId);

            TotalDevelopmentFee = 0;

            dt.AsEnumerable().ToList().ForEach(row =>
            {
                TotalDevelopmentFee += Convert.ToDecimal(row["DevelopmentFeesPaymentAmount"].ToString());
            });

            dgvPaymentReport.DataSource = dt;
            dgvPaymentReport.DataBind();

            if (dt.Rows.Count > 0)
            {
                dgvPaymentReport.FooterRow.Cells[6].Text = TotalDevelopmentFee.ToString("F2");
                btnDownload.Visible = true;
            }
            else
            {
                btnDownload.Visible = false;
            }
        }
Ejemplo n.º 3
0
        private void BindUploadList()
        {
            //dgvError.DataSource = null;
            //dgvError.DataBind();

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = objMemberPayment.GetFeesHeadWisePaymentReport("", 0, "All", DateTime.MinValue, DateTime.MinValue, 0, 0);
            DataView  dv = new DataView(dt);

            dv.RowFilter = "IsExcelUpload = 'True'";

            dtList = dv.ToTable();

            dgvPaymentReport.DataSource = dtList;
            dgvPaymentReport.DataBind();
            BindFooter();

            if (dtList.Rows.Count > 0)
            {
                btnDownload.Visible = true;
            }
            else
            {
                btnDownload.Visible = false;
            }
        }
Ejemplo n.º 4
0
        private void LoadMemberOutstandingList()
        {
            int MemberId = Convert.ToInt32(Request.QueryString["MemberId"].ToString());

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataSet ds = objMemberPayment.GetDevelopmentFeesOutstandingReport(MemberId, FromDate, ToDate);

            if (ds.Tables[0].Rows.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("To,<br/>");
                sb.Append(ds.Tables[0].Rows[0]["MemberName"].ToString().ToUpper() + "<br/>");
                sb.Append(ds.Tables[0].Rows[0]["BlockName"].ToString().ToUpper() + ", " + ds.Tables[0].Rows[0]["DistrictName"].ToString().ToUpper() + "<br/>");
                sb.Append(ds.Tables[0].Rows[0]["StateName"].ToString().ToUpper() + "<br/>");
                sb.Append("Mobile No. " + ds.Tables[0].Rows[0]["MobileNo"].ToString().ToUpper());

                lblMemberDetail.Text = Server.HtmlDecode(sb.ToString());

                sb = new StringBuilder();
                sb.Append("Date: " + DateTime.Now.ToString("dd.MM.yyyy") + "<br/>");
                sb.Append("<b>Membership No. </b>" + ds.Tables[0].Rows[0]["MemberCode"].ToString().ToUpper() + "<br/>");
                sb.Append("<b>Membership Date </b>" + Convert.ToDateTime(ds.Tables[0].Rows[0]["MembershipDate"]).ToString("dd/MM/yyyy"));

                lblDate.Text = Server.HtmlDecode(sb.ToString());
            }

            dgvReport.DataSource = ds.Tables[1];
            dgvReport.DataBind();
        }
        private void LoadPaymentDetail(string PaymentNo)
        {
            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dtPayment = objMemberPayment.GetFeesHeadWisePaymentReport(PaymentNo, 0, "All", DateTime.MinValue, DateTime.MinValue, 0, 0);

            if (dtPayment != null)
            {
                lblSLNo.Text           = dtPayment.Rows[0]["SrlNo"].ToString();
                lblMemberCode.Text     = dtPayment.Rows[0]["MemberCode"].ToString();
                lblMemberName.Text     = dtPayment.Rows[0]["MemberName"].ToString();
                lblPO.Text             = dtPayment.Rows[0]["PO"].ToString();
                lblBlock.Text          = dtPayment.Rows[0]["BlockName"].ToString();
                lblDistrict.Text       = dtPayment.Rows[0]["DistrictName"].ToString();
                lblDate.Text           = Convert.ToDateTime(dtPayment.Rows[0]["PaymentDate"].ToString()).ToString("dd/MM/yyyy");
                lblPAC.Text            = "";
                lblSum.Text            = dtPayment.Rows[0]["RenewalFeesPaymentAmount"].ToString();
                lblGST.Text            = dtPayment.Rows[0]["RenewalFeesTaxPaymentAmount"].ToString();
                lblAdmissionFee.Text   = dtPayment.Rows[0]["AdmissionFeesPaymentAmount"].ToString();
                lblAdmissionGST.Text   = dtPayment.Rows[0]["AdmissionFeesTaxPaymentAmount"].ToString();
                lblDevelopmentFee.Text = dtPayment.Rows[0]["DevelopmentPaymentAmount"].ToString();
                lblTotal.Text          = dtPayment.Rows[0]["PaymentAmount"].ToString();
                lblNarration.Text      = dtPayment.Rows[0]["Narration"].ToString();
                lblChequeNo.Text       = dtPayment.Rows[0]["PaymentMode"].ToString();
            }
        }
        private void LoadConsolidatedOutstandingList()
        {
            int      StateId    = Convert.ToInt32(ddlState.SelectedValue.Trim());
            int      DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue.Trim());
            int      BlockId    = Convert.ToInt32(ddlBlock.SelectedValue.Trim());
            int      CategoryId = Convert.ToInt32(ddlMembershipCategory.SelectedValue.Trim());
            DateTime ToDate     = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            DateTime FromDate   = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            //string MemberName = txtMemberName.Text.Trim();
            string MemberName     = "";
            int    BusinessTypeId = Convert.ToInt32(ddlBusinessType.SelectedValue); //14/10/19-business type fieldfor search
            int    ReportType     = Convert.ToInt32(ddlReportType.SelectedValue.Trim());

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataSet ds = objMemberPayment.GetOutstandingReportConsolidatedNew(StateId, DistrictId, BlockId, CategoryId, ToDate, FromDate, MemberName, "", "", BusinessTypeId, ReportType);

            dgvMemberOutstanding.DataSource = ds.Tables[0];
            dgvMemberOutstanding.DataBind();
            btnDownload.Visible = true;
            //btnSendEmail_Click.Visible = false;
            ////dgvMemberOutstanding.FindControl("lbl_GrandOpeningBalance");
            //    ((Label)dgvMemberOutstanding.FooterRow.FindControl("lbl_GrandOpeningBalance")).Text = ds.Tables[0].Compute("Sum(TotalOpening)", "").ToString();
            ////lbl_GrandTotalBill.Text = ds.Tables[0].Compute("Sum(TotalBill)", "").ToString();
            ////lbl_GrandTotalPaid.Text = ds.Tables[0].Compute("Sum(Totalpaid)", "").ToString();
            ////lbl_GrandTotalDue.Text = ds.Tables[0].Compute("Sum(TotalDue)", "").ToString();
        }
Ejemplo n.º 7
0
        protected void LoadFeeCollectionReport()
        {
            int      DistrictId = int.Parse(ddlDistrict.SelectedValue);
            string   FromDate1 = (txtFromDate.Text.ToString());
            string   ToDate1 = (txtToDate.Text.ToString());
            DateTime FromDate, ToDate;

            if (FromDate1 != "" && ToDate1 != "")
            {
                FromDate = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
                ToDate   = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            }
            else
            {
                FromDate = DateTime.MinValue; ToDate = DateTime.MinValue;
            }
            BusinessLayer.Common.MemberPayment ObjFee = new BusinessLayer.Common.MemberPayment();
            DataTable dt = ObjFee.GetFeeCollectionBusinessTypeReport(DistrictId, FromDate, ToDate);

            if (dt.Rows.Count > 0)
            {
                dgvFeeCollectionReport.DataSource = dt;
                dgvFeeCollectionReport.DataBind();
                btnExportExcel.Visible = true;
            }
            else
            {
                btnExportExcel.Visible = false;
            }
            //Total Footer Added
        }
Ejemplo n.º 8
0
        private void LoadConsolidatedOutstandingList()
        {
            int      StateId    = Convert.ToInt32(ddlState.SelectedValue.Trim());
            int      DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue.Trim());
            int      BlockId    = Convert.ToInt32(ddlBlock.SelectedValue.Trim());
            int      CategoryId = Convert.ToInt32(ddlMembershipCategory.SelectedValue.Trim());
            DateTime ToDate     = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            DateTime FromDate   = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            string   MemberName = txtMemberName.Text.Trim();
            string   MemberCode = txtMemberCode.Text.Trim();
            string   MobileNo   = txtMobileNo.Text.Trim();

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = objMemberPayment.GetExecutiveCommitteeReport(StateId, DistrictId, BlockId, CategoryId, ToDate, FromDate, MemberName, MemberCode, MobileNo);

            dgvMemberOutstanding.DataSource = dt;
            dgvMemberOutstanding.DataBind();

            if (dt.Rows.Count > 0)
            {
                btnDownload.Visible = true;
            }
            else
            {
                btnDownload.Visible = false;
            }
        }
Ejemplo n.º 9
0
        protected void dgvPaymentReport_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            BusinessLayer.Common.MemberPayment ObjMemberPayment = new BusinessLayer.Common.MemberPayment();
            int Id = Convert.ToInt32(dgvPaymentReport.DataKeys[e.RowIndex].Values["PaymentId"].ToString());

            ObjMemberPayment.Delete(Id);
            LoadPaymentList();
        }
Ejemplo n.º 10
0
        protected void dgvPaymentReport_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            BusinessLayer.Common.MemberPayment ObjMemberPayment = new BusinessLayer.Common.MemberPayment();
            int Id = Convert.ToInt32(dgvPaymentReport.DataKeys[e.RowIndex].Values["PaymentId"].ToString());

            ObjMemberPayment.Delete(Id);
            BindUploadList();
            ShowMessage("Payment detail deleted successfully", true);
        }
Ejemplo n.º 11
0
        private void LoadPaymentList()
        {
            string   PaymentNo        = txtPaymentNo.Text.Trim();
            string   PaymentMode      = ddlPaymentMode.SelectedValue;
            int      CashBankLedgerId = Convert.ToInt32(ddlCashBankLedger.SelectedValue);
            int      MemberId         = Convert.ToInt32(ddlMember.SelectedValue);
            DateTime FromDate         = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            DateTime ToDate           = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);
            int      BusinessTypeId   = Convert.ToInt32(ddlBusinessType.SelectedValue);

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = objMemberPayment.GetFeesHeadWisePaymentReport(PaymentNo, CashBankLedgerId, PaymentMode, FromDate, ToDate, MemberId, BusinessTypeId);
            DataView  dv = new DataView(dt);

            if (Session["UserType"].ToString().Equals("Agent"))
            {
                dv.RowFilter = "CreatedBy = " + Session["UserId"].ToString() + " AND CreatedByUserType = 'Agent'";
            }

            dt = dv.ToTable();

            decimal TotalAdmissionFees = 0, TotalAdmissionFeesTax = 0, TotalRenewalFees = 0, TotalRenewalFeesTax = 0, Total = 0, TotalDevelopmentFee = 0;

            dt.AsEnumerable().ToList().ForEach(row =>
            {
                Total += Convert.ToDecimal(row["PaymentAmount"].ToString());
                TotalAdmissionFees    += Convert.ToDecimal(row["AdmissionFeesPaymentAmount"].ToString());
                TotalRenewalFees      += Convert.ToDecimal(row["RenewalFeesPaymentAmount"].ToString());
                TotalAdmissionFeesTax += Convert.ToDecimal(row["AdmissionFeesTaxPaymentAmount"].ToString());
                TotalRenewalFeesTax   += Convert.ToDecimal(row["RenewalFeesTaxPaymentAmount"].ToString());
                TotalDevelopmentFee   += Convert.ToDecimal(row["DevelopmentPaymentAmount"].ToString());
            });


            dgvPaymentReport.DataSource = dt;
            dgvPaymentReport.DataBind();
            if (dt.Rows.Count > 0)
            {
                dgvPaymentReport.FooterRow.Cells[6].Text  = TotalAdmissionFees.ToString("F2");
                dgvPaymentReport.FooterRow.Cells[7].Text  = TotalAdmissionFeesTax.ToString("F2");
                dgvPaymentReport.FooterRow.Cells[8].Text  = TotalRenewalFees.ToString("F2");
                dgvPaymentReport.FooterRow.Cells[9].Text  = TotalRenewalFeesTax.ToString("F2");
                dgvPaymentReport.FooterRow.Cells[10].Text = TotalDevelopmentFee.ToString("F2");
                dgvPaymentReport.FooterRow.Cells[11].Text = Total.ToString("F2");

                btnDownload.Visible = true;
            }
            else
            {
                btnDownload.Visible = false;
            }
        }
Ejemplo n.º 12
0
        protected void dgvPaymentReport_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("Approve"))
            {
                BusinessLayer.Common.MemberPayment ObjMemberPayment = new BusinessLayer.Common.MemberPayment();
                ObjMemberPayment.Approve(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session["UserId"].ToString()));
                LoadPaymentList();

                Message.IsSuccess = true;
                Message.Text      = "Payment Approved";
                Message.Show      = true;
            }
        }
Ejemplo n.º 13
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            int BlockId = Convert.ToInt32(ddlBlock.SelectedValue.Trim());

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            int i = objMemberPayment.GenerateMemberBill_SpecialCase(BlockId);

            if (i > 0)
            {
                Message.IsSuccess = true;
                Message.Text      = "Bill Generated Successfully";
                Message.Show      = true;
            }
        }
Ejemplo n.º 14
0
        private void LoadMemberOutstandingList()
        {
            int      MemberId = Convert.ToInt32(ddlMember.SelectedValue);
            DateTime FromDate = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            DateTime ToDate   = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataSet ds = objMemberPayment.GetOutstandingReport(MemberId, FromDate, ToDate);

            if (ds.Tables[0].Rows.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("To,<br/>");
                sb.Append(ds.Tables[0].Rows[0]["MemberName"].ToString().ToUpper() + "<br/>");
                sb.Append(ds.Tables[0].Rows[0]["BlockName"].ToString().ToUpper() + ", " + ds.Tables[0].Rows[0]["DistrictName"].ToString().ToUpper() + "<br/>");
                sb.Append(ds.Tables[0].Rows[0]["StateName"].ToString().ToUpper() + "<br/>");
                sb.Append("Mobile No. " + ds.Tables[0].Rows[0]["MobileNo"].ToString().ToUpper());

                lblMemberDetail.Text = Server.HtmlDecode(sb.ToString());

                sb = new StringBuilder();
                sb.Append("Date: " + DateTime.Now.ToString("dd.MM.yyyy") + "<br/>");
                sb.Append("<b>Membership No. </b>" + ds.Tables[0].Rows[0]["MemberCode"].ToString().ToUpper() + "<br/>");
                sb.Append("<b>Membership Date </b>" + Convert.ToDateTime(ds.Tables[0].Rows[0]["MembershipDate"]).ToString("dd/MM/yyyy"));

                lblDate.Text = Server.HtmlDecode(sb.ToString());
            }

            dgvReport.DataSource = ds.Tables[1];
            dgvReport.DataBind();

            //dgvMemberOutstanding.DataSource = dt;
            //dgvMemberOutstanding.DataBind();

            //if (dt.Rows.Count > 0)
            //{
            // btnDownload.Visible = true;
            // }
            //else
            //{
            //btnDownload.Visible = false;
            // }
        }
Ejemplo n.º 15
0
        private void LoadPaymentDetail()
        {
            BusinessLayer.Common.MemberPayment ObjMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dtPayment = ObjMemberPayment.GetAllById(PaymentId);

            txtPaymentNo.Text       = dtPayment.Rows[0]["PaymentNo"].ToString();
            ddlMember.SelectedValue = dtPayment.Rows[0]["MemberId"].ToString();
            ddlMember.Enabled       = false;
            txtMobileNo.Enabled     = false;
            btnSearch.Enabled       = false;

            txtPaymentAmount.Text        = dtPayment.Rows[0]["PaymentAmount"].ToString();
            ddlPaymentMode.SelectedValue = dtPayment.Rows[0]["PaymentMode"].ToString();
            hdnAmount.Value = dtPayment.Rows[0]["PaymentAmount"].ToString();

            if (Session["UserType"].ToString().Equals("Member"))//Session["UserType"].ToString().Equals("Agent") ||
            {
                ddlPaymentMode.Enabled = false;
            }
            else
            {
                ddlPaymentMode.Enabled = true;
            }

            txtPaymentDate.Text    = Convert.ToDateTime(dtPayment.Rows[0]["PaymentDate"].ToString()).ToString("dd/MM/yyyy");
            txtPaymentDate.Enabled = false;

            ddlCashBankLedger.SelectedValue = dtPayment.Rows[0]["CashBankLedgerId"].ToString();

            if (Session["UserType"].ToString().Equals("Agent") || Session["UserType"].ToString().Equals("Member"))
            {
                ddlCashBankLedger.Enabled = false;
            }
            else
            {
                ddlCashBankLedger.Enabled = true;
            }
            LoadLedgerOpeningBalance();

            txtNarration.Text = dtPayment.Rows[0]["Narration"].ToString();
            Message.Show      = false;
        }
Ejemplo n.º 16
0
        private void LoadMemberOutstandingList()
        {
            int FinYrId  = Convert.ToInt32(Session["FinYrID"].ToString());
            int MemberId = Convert.ToInt32(ddlMember.SelectedValue);

            if (MemberId != 0)
            {
                BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
                DataTable dt = objMemberPayment.GetOutstanding(MemberId, PaymentId, FinYrId);
                dgvMemberOutstanding.DataSource = dt;
                dgvMemberOutstanding.DataBind();
                PaymentAmount = 1;//Convert.ToDecimal(dt.Compute("Sum(FeesOutstandingAmount)", string.Empty)) +
                //Convert.ToDecimal(dt.Compute("Sum(TaxOutstandingAmount)", string.Empty));
            }
            else
            {
                dgvMemberOutstanding.DataSource = null;
                dgvMemberOutstanding.DataBind();
            }
        }
Ejemplo n.º 17
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            int      FeesHeadId = Convert.ToInt32(ddlFeesHead.SelectedValue);
            DateTime FromDate   = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            DateTime ToDate     = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);

            BusinessLayer.Common.MemberPayment ObjMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = ObjMemberPayment.GetServiceTaxReport(FeesHeadId, FromDate, ToDate);

            dgvServiceTax.DataSource = dt;
            dgvServiceTax.DataBind();

            if (dt.Rows.Count > 0)
            {
                btnExport.Visible = true;
            }
            else
            {
                btnExport.Visible = false;
            }
        }
        private void LoadPaymentList()
        {
            int      AgentId  = Convert.ToInt32(ddlAgent.SelectedValue);
            DateTime FromDate = Convert.ToDateTime(txtFromDate.Text.Split('/')[2] + "-" + txtFromDate.Text.Split('/')[1] + "-" + txtFromDate.Text.Split('/')[0]);
            DateTime ToDate   = Convert.ToDateTime(txtToDate.Text.Split('/')[2] + "-" + txtToDate.Text.Split('/')[1] + "-" + txtToDate.Text.Split('/')[0]);

            bool?IsApproved = null;

            if (ddlApprovalStatus.SelectedIndex == 1)
            {
                IsApproved = true;
            }
            else if (ddlApprovalStatus.SelectedIndex == 2)
            {
                IsApproved = false;
            }

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            DataTable dt = objMemberPayment.GetAgentWisePaymentReport(AgentId, FromDate, ToDate, IsApproved);

            decimal TotalPaymentAmount = 0;

            dt.AsEnumerable().ToList().ForEach(row =>
            {
                TotalPaymentAmount += Convert.ToDecimal(row["PaymentAmount"].ToString());
            });

            dgvPaymentReport.DataSource = dt;
            dgvPaymentReport.DataBind();

            if (dt.Rows.Count > 0)
            {
                dgvPaymentReport.FooterRow.Cells[6].Text = TotalPaymentAmount.ToString("F2");
                btnDownload.Visible = true;
            }
            else
            {
                btnDownload.Visible = false;
            }
        }
        private void LoadMemberOutstandingList()
        {
            int FinYrId  = Convert.ToInt32(Session["FinYrID"].ToString());
            int MemberId = Convert.ToInt32(ddlMember.SelectedValue);

            if (MemberId != 0)
            {
                BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
                DataView DV = new DataView(objMemberPayment.GetOutstanding(MemberId, PaymentId, FinYrId));
                DV.RowFilter = "FeesHeadId IN (1,2)";
                DataTable dt = new DataTable();
                dt = DV.ToTable();
                if (dt != null)
                {
                    dgvMemberOutstanding.DataSource = dt;
                    dgvMemberOutstanding.DataBind();
                }
            }
            else
            {
                dgvMemberOutstanding.DataSource = null;
                dgvMemberOutstanding.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //if (Request.Form["encResp"] != null && Request.Form["encResp"].Length > 0) { Response.Write("<script>alert('Payment Cancel '" + Request.Form["encResp"] + ");</script>"); }
            try
            {
                Message.Show = false;
                if (Request.Form.AllKeys.Contains("encResp"))
                {
                    if (Request.Form["encResp"] != null && Request.Form["encResp"].Length > 0)
                    {
                        string              workingKey  = "FF119789EA009958AC9FF44758A5A526";// "272ECCEC820303D21327C07B92A5A367";//"FF119789EA009958AC9FF44758A5A526";//put in the 32bit alpha numeric key in the quotes provided here
                        CCA.Util.CCACrypto  ccaCrypto   = new CCA.Util.CCACrypto();
                        string              encResponse = ccaCrypto.Decrypt(Request.Form["encResp"], workingKey);
                        NameValueCollection Params      = new NameValueCollection();

                        string[] segments = encResponse.Split('&');
                        foreach (string seg in segments)
                        {
                            string[] parts = seg.Split('=');
                            if (parts.Length > 0)
                            {
                                string Key   = parts[0].Trim();
                                string Value = parts[1].Trim();
                                Params.Add(Key, Value);
                            }
                        }
                        #region
                        //string jsMethodName = "";
                        //for (int i = 0; i < Params.Count; i++)
                        //{
                        //    StringBuilder sb = new StringBuilder();
                        //    jsMethodName+=("<tr><td class='label'>" + Params.Keys[i] + "</td><td>" + Params[i] + "</td></tr>");
                        //    //Response.Write(Params.Keys[i] + " = " + Params[i] + "<br>");
                        //}
                        //string[] values = null;
                        //foreach (string key in Params.Keys)
                        //{
                        //    values = Params.GetValues(key);
                        //    foreach (string value in values)
                        //    {
                        //        //MessageBox.Show(key + " - " + value);
                        //        //if (key.Equals("order_id"))
                        //        //{
                        //        //    lblOrderId.Text = Params["order_id"];
                        //        //}
                        //        Response.Write(key + " = " + value + "<br>");
                        //    }
                        //}
                        #endregion
                        order_id.Text        = Params["order_id"];
                        tracking_id.Text     = Params["tracking_id"];
                        bank_ref_no.Text     = Params["bank_ref_no"];
                        order_status.Text    = Params["order_status"];
                        mer_amount.Text      = Params["mer_amount"];
                        trans_date.Text      = Params["trans_date"];
                        failure_message.Text = Params["failure_message"];
                        payment_mode.Text    = Params["payment_mode"];
                        billing_name.Text    = Params["billing_name"];
                        //ScriptManager.RegisterClientScriptBlock(this, typeof(string), "ALert", "alert('" + jsMethodName + "')", true);

                        Entity.Common.PaymentGateway payment = new Entity.Common.PaymentGateway();
                        payment.PaymentId      = Convert.ToInt32(Params["merchant_param1"]);
                        payment.MemberId       = Convert.ToInt32(Params["merchant_param2"]);
                        payment.MemberType     = Params["merchant_param3"];
                        payment.OrderId        = Params["order_id"];
                        payment.TrackingId     = Params["tracking_id"];
                        payment.BankRefNo      = Params["bank_ref_no"];
                        payment.OrderStatus    = Params["order_status"];
                        payment.PaymentAmount  = Convert.ToDecimal(Params["mer_amount"]);
                        payment.FailureMessage = Params["failure_message"];
                        payment.PaymentMode    = Params["payment_mode"];
                        string transDate = Params["trans_date"];
                        if (transDate != null && transDate.Length > 0)
                        {
                            string[] tranDate  = transDate.Split(' ');
                            string[] tranDate1 = tranDate[0].Split('/');
                            payment.PaymentDate = Convert.ToDateTime(tranDate1[2] + "-" + tranDate1[1] + "-" + tranDate1[0] + " " + tranDate[1]);// Params["trans_date"]);
                        }
                        else
                        {
                            payment.PaymentDate = DateTime.Now;
                        }
                        payment.Currency      = Params["currency"];
                        payment.CardName      = Params["card_name"];
                        payment.StatusCode    = Params["status_code"];
                        payment.StatusMessage = Params["status_message"];
                        payment.CardName      = Params["card_name"];
                        payment.CreatedBy     = Session["UserId"] != null?Convert.ToInt32(Session["UserId"]) : 0;

                        BusinessLayer.Common.MemberPayment ObjPayment = new BusinessLayer.Common.MemberPayment();
                        //DataTable DT = ObjPayment.GetAllById(payment.PaymentId);

                        //if (Convert.ToDecimal(DT.Rows[0]["PaymentAmount"]) == payment.PaymentAmount)
                        //{
                        ObjPayment.PaymentResponseSave(payment);
                        //}
                        //else
                        //{
                        //    order_status.Text = "Transaction Failed";
                        //    failure_message.Text = "Amount is not matched";
                        //}
                        if (payment.OrderStatus == "Success")
                        {
                            order_status.ForeColor = System.Drawing.Color.Green;
                            Message.IsSuccess      = true;
                            Message.Text           = "Payment detail saved successfully";
                        }
                        else
                        {
                            order_status.ForeColor    = System.Drawing.Color.Red;
                            failure_message.ForeColor = System.Drawing.Color.Red;
                            Message.IsSuccess         = false;
                            Message.Text = "Please try again later!";
                        }
                        Message.Show = true;
                    }
                    else
                    {
                        Response.Write("<script>alert('Payment Cancel ');</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('Payment Cancel ');</script>");
                }
            }
            catch (Exception ex) { Message.Text = ex.Message; Message.Show = true; }
            //}
        }
Ejemplo n.º 21
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Message.Show = false;
            FeesXml      = "<NewDataSet>";

            foreach (GridViewRow gvr in dgvMemberOutstanding.Rows)
            {
                if (gvr.RowType == DataControlRowType.DataRow)
                {
                    FeesXml += "<Row";
                    FeesXml += "  FeesHeadId = \"" + dgvMemberOutstanding.DataKeys[gvr.RowIndex].Values["FeesHeadId"].ToString() + "\"";
                    FeesXml += "  FeesPaymentAmount = \"" + (string.IsNullOrEmpty(((TextBox)gvr.FindControl("txtFeesPaymentAmount")).Text.Trim()) ? "0" : ((TextBox)gvr.FindControl("txtFeesPaymentAmount")).Text.Trim()) + "\"";
                    FeesXml += "  TaxPaymentAmount = \"" + (string.IsNullOrEmpty(((TextBox)gvr.FindControl("txtTaxPaymentAmount")).Text.Trim()) ? "0" : ((TextBox)gvr.FindControl("txtTaxPaymentAmount")).Text.Trim()) + "\"";
                    FeesXml += " />";
                }
            }

            FeesXml += "</NewDataSet>";

            BusinessLayer.Common.MemberPayment objMemberPayment = new BusinessLayer.Common.MemberPayment();
            Entity.Common.MemberPayment        payment          = new Entity.Common.MemberPayment();
            payment.PaymentId   = PaymentId;
            payment.MemberId    = Convert.ToInt32(ddlMember.SelectedValue);
            payment.PaymentMode = ddlPaymentMode.SelectedValue;
            payment.PaymentDate = Convert.ToDateTime(txtPaymentDate.Text.Split('/')[2] + "-" + txtPaymentDate.Text.Split('/')[1] + "-" + txtPaymentDate.Text.Split('/')[0]);
            //if (Session["UserType"].ToString().Equals("Member")) { payment.PaymentAmount = PaymentAmount; }//PaymentAmount; }
            //else
            //{
            payment.PaymentAmount = Convert.ToDecimal(hdnAmount.Value.Trim());
            //}
            payment.Narration         = txtNarration.Text.Trim();
            payment.CreatedBy         = Convert.ToInt32(Session["UserId"].ToString());
            payment.CreatedByUserType = Session["UserType"].ToString();
            payment.CashBankLedgerId  = Convert.ToInt32(ddlCashBankLedger.SelectedValue);
            payment.FeesXml           = FeesXml;
            payment.IsExcelUpload     = false;

            if (Session["UserType"].ToString().Equals("Admin") || Session["UserType"].ToString().Equals("Agent"))
            {
                payment.IsApproved   = true;
                payment.ApprovedBy   = Convert.ToInt32(Session["UserId"].ToString());
                payment.ApprovedDate = DateTime.Now;
            }
            else
            {
                payment.IsApproved   = null;
                payment.ApprovedBy   = null;
                payment.ApprovedDate = null;
            }

            string strPaymentNo = objMemberPayment.Save(payment);

            PaymentId         = 0;
            txtPaymentNo.Text = strPaymentNo;

            LoadMemberOutstandingList();

            txtPaymentAmount.Text  = "0.00";
            txtPaymentDate.Enabled = true;
            txtNarration.Text      = "";
            LoadLedgerOpeningBalance();
            btnPrint.Visible  = true;
            Message.IsSuccess = true;
            Message.Text      = "Payment detail saved successfully";
            Message.Show      = true;

            if (Session["UserType"].ToString().Equals("Member") && ddlPaymentMode.SelectedItem.Text.ToUpper().Equals("ONLINE PAYMENT"))
            {
                //Response.Redirect(@"https://www.onlinesbi.com/prelogin/icollecthome.htm?corpid=649959");
                BusinessLayer.Common.MemberPayment ObjPayment  = new BusinessLayer.Common.MemberPayment();
                Entity.Common.PaymentGateway       paymentGate = new Entity.Common.PaymentGateway();
                paymentGate.PaymentId     = payment.PaymentId;
                paymentGate.MemberId      = payment.MemberId;
                paymentGate.MemberType    = "Member";
                paymentGate.OrderId       = GetAutoTransactionId();
                paymentGate.PaymentAmount = payment.PaymentAmount;
                paymentGate.Currency      = "INR";
                paymentGate.CreatedBy     = payment.CreatedBy;
                ObjPayment.PaymentResponseSave(paymentGate);//&tid=76023071
                string ccaRequest = "merchant_id=211354&order_id=" + paymentGate.OrderId + "&amount=" + payment.PaymentAmount + "&currency=INR&"
                                    + "redirect_url=http://accounts.wbpoultryfederation.org/ccavResponseHandler.aspx&cancel_url=http://accounts.wbpoultryfederation.org/MemberDefault.aspx&";
                //+ "redirect_url=http://localhost:1044/ccavResponseHandler.aspx&cancel_url=http://localhost:1044/ccavResponseHandler.aspx&";
                ccaRequest += "billing_name=" + ddlMember.SelectedItem.Text +
                              "&billing_address=46C, Chowringhee Road, 11th Floor, Room No - C&billing_city=Kolkata&billing_state=West Bengal&billing_zip=700071&billing_country=India&billing_tel=03365229085&[email protected]&"
                              + "delivery_name=" + ddlMember.SelectedItem.Text + "&delivery_address=46C, Chowringhee Road, 11th Floor, Room No - C&delivery_city=Kolkata&delivery_state=West Bengal&delivery_zip=700071&delivery_country=India&delivery_tel=03365229085"
                              + "&merchant_param1=" + payment.PaymentId + "&merchant_param2=" + payment.MemberId + "&merchant_param3=Member";
                string strEncRequest = ccaCrypto.Encrypt(ccaRequest, workingKey);
                Response.Redirect("../ccavRequestHandler.aspx?DATA=" + strEncRequest);
            }
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "VariableRegisteration", "window.open('renewal-bill.aspx?PaymentNo=" + strPaymentNo + "','','height=600,width=1000')", true);
        }