// show IND PAs in delete modal
        private void BindEventRepeater(int personId)
        {
            DALMembership db = new DALMembership();

            rptrIAdets.DataSource = db.GetIndivPAInfo(personId);
            rptrIAdets.DataBind();
        }
        protected void Submit_Ter(object sender, EventArgs e)
        {
            if ((string)(Session["IndividualID"]) != null)
            {
                int createindcheck = 0;
                try
                {
                    var sent_date     = sentdate.Value;
                    var received_date = receiveddate.Value;
                    var ter_details   = terdetails.Value;

                    if (!string.IsNullOrEmpty(sent_date) && !string.IsNullOrEmpty(received_date))
                    {
                        DALMembership mem = new DALMembership();
                        createindcheck = mem.EditTerIndividual(individualID.Value, DateTime.Parse(sent_date), DateTime.Parse(received_date), ter_details, DateTime.Now);
                        if (createindcheck == 0)
                        {
                            ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "displaySuccess('Successfully Renewed!');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                    }
                }
                catch (Exception ex)
                {
                    ErrorLog.WriteErrorLog(ex.ToString());
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["OrgId"] != null)
            {
                string orgId = Session["OrgId"].ToString();
                GridView1.DataSource = dao.GetOrganizationMembershipContribution(orgId);
                GridView1.DataBind();
            }

            if (!IsPostBack)
            {
                string        OrganisationName = (string)(Session["OrganisationID"]);
                DALMembership dao    = new DALMembership();
                MemberInfo    member = new MemberInfo();
                member = dao.GetOrganisationDataRenewal(OrganisationName);
                if (member.DonorTier != null)
                {
                    lblExpiryDate.InnerText = member.ExpiryDate;
                    lblDonorTier.InnerText  = member.DonorTier;
                    orgName.Value           = member.IndividualName;
                    orgName.Value           = OrganisationName;
                    lblOrgName.InnerText    = orgName.Value;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string        IndividualID = (string)(Session["IndividualID"]);
         DALMembership dao          = new DALMembership();
         MemberInfo    member       = new MemberInfo();
         member = dao.GetIndividualDataRenewal(IndividualID);
         if (member.DonorTier != null)
         {
             datetime.Value              = DateTime.Now.AddYears(1).ToString("dd/MM/yyyy");
             paymentreceiveddate.Value   = DateTime.Now.ToString("dd/MM/yyyy");
             individualName.Value        = member.IndividualName;
             individualID.Value          = IndividualID;
             UserRenewalHeader.InnerText = "Renewal For " + individualName.Value;
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
         }
         if (member != null && member.MemberId > 0)
         {
             PopulateControlsIfPartiallyPaid(member.MemberId, IndividualID);
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string OrganisationID = (string)(Session["OrganisationID"]);
                string ContributionID = (string)(Session["ContributionIdOrg"]);//ContributionID

                DALMembership dao    = new DALMembership();
                MemberInfo    member = new MemberInfo();
                member = dao.GetOrgData(OrganisationID);
                if (OrganisationID != null)
                {
                    //If session "IndividualID" is equals null, means delete button event was triggered from Member_MemberManagement.aspx table
                    title.InnerText         = "Membership > Member TER";
                    organisationID.Value    = OrganisationID;
                    contributionID.Value    = ContributionID;
                    UserTerHeader.InnerText = "TER For " + organisationID.Value;
                    sentdate.Value          = DateTime.Now.ToString("dd/MM/yyyy");
                    receiveddate.Value      = DateTime.Now.ToString("dd/MM/yyyy");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["PersonId"] != null)
            {
                string indId = Session["PersonId"].ToString();
                GridView1.DataSource = dao.GetIndividualMembershipContribution(indId);
                GridView1.DataBind();
            }

            if (!IsPostBack)
            {
                string        IndividualEmail = (string)(Session["IndividualID"]);
                DALMembership dao             = new DALMembership();
                MemberInfo    member          = new MemberInfo();
                member = dao.GetIndividualDataRenewal(IndividualEmail);
                if (member.DonorTier != null)
                {
                    lblExpiryDate.InnerText = member.ExpiryDate;
                    lblDonorTier.InnerText  = member.DonorTier;
                    indName.Value           = member.IndividualName;
                    //      indName.Value = IndividualEmail;
                    lblIndName.InnerText = indName.Value;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
        // show IND PAs in delete modal
        private void BindEventRepeater(int personId)
        {
            string pid = hiddentextPersonID.Value.ToString();

            DALMembership db = new DALMembership();

            rptrIAdets.DataSource = db.GetIndivPAInfo(personId);
            rptrIAdets.DataBind();
        }
        //edit in modal
        protected void PersonSave_ServerClick(object sender, EventArgs e)
        {
            int personId = int.Parse(hdnPersonEdit.Value);

            if (personId > 0)
            {
                DALMembership user  = new DALMembership();
                int           check = user.EditModalPerson(personId, IndTbGivenName.Text, IndTbSirname.Text, IndDdlGender.Text, IndTbSource.Text, IndDdlHonorific.Text, IndTbSalutation.Text, IndTbTelephone.Text, IndTbEmail.Text, IndDdlNationality.Text, DateTime.Now, IndTbDes1.Text, IndTbDep1.Text, IndTbOrg1.Text, IndTbDes2.Text, IndTbDep2.Text, IndTbOrg2.Text, IndTbSDR.Text, IndTbfullNameNT.Text);
                if (check == 1)
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "displaySuccess('Successfully Updated for Individual Associate: " + IndTbfullNameNT.Text + "');", true);
                    gvPerson.DataSource = mem.getAllMembershipDetailPerson();
                    gvPerson.DataBind();
                    gvPerson.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
                else if (check == 0)
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
        private void PopulateControlsIfPartiallyPaid(int memberId, string emailAddress)
        {
            DALMembership dao = new DALMembership();
            bool          hasPartialPayment = dao.HasMemberPartiallyPaid(memberId);

            if (hasPartialPayment)
            {
                int   contributionId = Convert.ToInt32(Session["ContributionID"]);
                float amountPaid     = dao.GetPartialPayment(contributionId);
                var   member         = dao.GetIndividualDataRenewal(emailAddress);
                hdnDonor.Value       = member.DonorTier;
                hdnInstallment.Value = amountPaid.ToString();
                hdnExpDate.Value     = member.ExpiryDate;
                hdnStatus.Value      = "Partial";
                memfee.Disabled      = true;
            }
            else
            {
                hdnStatus.Value = "Full";
            }
        }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string        OrganisationID = (string)(Session["OrganisationID"]);
         DALMembership dao            = new DALMembership();
         MemberInfo    member         = new MemberInfo();
         member = dao.GetOrgData(OrganisationID);
         if (member.DonorTier != null)
         {
             // if show date from gv to tb
             // datetime.Value = (member.ExpiryDate).ToShortDateString();
             datetime.Value              = DateTime.Now.AddYears(1).ToString("dd/MM/yyyy");
             paymentreceiveddate.Value   = DateTime.Now.ToString("dd/MM/yyyy");
             organisationID.Value        = OrganisationID;
             UserRenewalHeader.InnerText = "Renewal For " + organisationID.Value;
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
         }
     }
 }
示例#11
0
        protected void Submit_Renewal(object sender, EventArgs e)
        {
            if (cbpaid.Checked)
            {
                int createindcheck = 0;
                IndividualContribution individualContribution = new IndividualContribution();
                individualContribution.Amoount                 = decimal.Parse(memfee.Value);
                individualContribution.PaymentReceivedDate     = DateTime.Parse(paymentreceiveddate.Value);
                individualContribution.PaymentPurpose          = "Membership";
                individualContribution.PaymentMode             = PaymentMode.Value;
                individualContribution.ExpiryDate              = datetime.Value;
                individualContribution.DonorTier               = Donor_Tier.Value;
                individualContribution.TotalAmount             = decimal.Parse(memfee.Value);
                individualContribution.PaymentDetails          = remarks.Value;
                individualContribution.CreatedDate             = DateTime.Now;
                individualContribution.ContributionCreatedDate = DateTime.Now;
                individualContribution.ContributionDate        = DateTime.Now;
                individualContribution.PersonId                = int.Parse(Session["PersonId"].ToString());
                individualContribution.Status = "Full";
                if (cbInstallment.Checked)
                {
                    individualContribution.Amoount = decimal.Parse(txtInstallment.Value);
                    individualContribution.Status  = "Installment";
                }
                if (!string.IsNullOrEmpty(individualContribution.DonorTier) && !string.IsNullOrEmpty(individualContribution.PaymentMode))
                {
                    if (individualContribution.DonorTier == "Friend of IPS")
                    {
                        individualContribution.ExpiryDate = datetime.Value;
                    }
                    else if (individualContribution.DonorTier == "Lifetime Friend of IPS" || individualContribution.DonorTier == "Lifetime Benefactor of IPS" ||
                             individualContribution.DonorTier == "Lifetime Patron of IPS")
                    {
                        datetime.Value = individualContribution.ExpiryDate = "NA";
                    }

                    DALMembership mem = new DALMembership();
                    // individual
                    int updateindcheck = mem.EditIndividual(individualContribution.DonorTier, individualContribution.ExpiryDate, individualID.Value, DateTime.Now);

                    createindcheck = mem.InsertIndividualContribution(individualContribution);
                    //decimal amt, string paymentreceiveddate, DateTime createddate, string paymentdets, string paymentmode, string paymentpurpose, decimal totalamt, DateTime contridate
                    if (createindcheck == 0)
                    {
                        //ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "displaySuccess('Successfully Renewed!');", true);
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackChecked();", true);
                    }
                }
                else
                {
                    //ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedFailure();", true);
                }
            }
            else
            {
                //Update Membership Table if unchecked
                var expiry_date = datetime.Value;
                var donortier   = Donor_Tier.Value;
                if (!string.IsNullOrEmpty(donortier))
                {
                    if (donortier == "Friend of IPS")
                    {
                        expiry_date = datetime.Value;
                    }
                    else if (donortier == "Lifetime Friend of IPS" || donortier == "Lifetime Benefactor of IPS" ||
                             donortier == "Lifetime Patron of IPS")
                    {
                        expiry_date    = "NA";
                        datetime.Value = expiry_date;
                    }

                    DALMembership mem = new DALMembership();

                    //individual
                    int indcheck = mem.EditIndividual(donortier, expiry_date, individualID.Value, DateTime.Now);
                    if (indcheck > 0)
                    {
                        // ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "displaySuccess('Successfully Renewed!');", true);
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackUnchecked();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
        protected void Submit_Renewal(object sender, EventArgs e)
        {
            var expiry_date = datetime.Value;
            var donortier   = Donor_Tier.Value;

            if (donortier == "Friend of IPS")
            {
                expiry_date = datetime.Value;
            }
            else if (donortier == "Lifetime Friend of IPS" || donortier == "Lifetime Benefactor of IPS" ||
                     donortier == "Lifetime Patron of IPS")
            {
                expiry_date       = "NA";
                datetime.Value    = expiry_date;
                datetime.Disabled = true;
            }

            DALMembership mem = new DALMembership();

            if (cbpaid.Checked)
            {
                int createindcheck = 0;
                IndividualContribution individualContribution = new IndividualContribution();
                individualContribution.PaymentReceivedDate     = DateTime.Parse(paymentreceiveddate.Value);
                individualContribution.PaymentPurpose          = "Membership";
                individualContribution.PaymentMode             = PaymentMode.Value;
                individualContribution.ExpiryDate              = datetime.Value;
                individualContribution.DonorTier               = Donor_Tier.Value;
                individualContribution.PaymentDetails          = remarks.Value;
                individualContribution.CreatedDate             = DateTime.Now;
                individualContribution.ContributionCreatedDate = DateTime.Now;
                individualContribution.ContributionId          = (string)(Session["ContributionID"]);
                individualContribution.ContributionDate        = DateTime.Now;
                individualContribution.PersonId = int.Parse(Session["PersonId"].ToString());
                individualContribution.Status   = "Full";

                if (hdnStatus.Value.Contains("Partial"))
                {
                    if (!string.IsNullOrEmpty(individualContribution.PaymentMode))
                    {
                        if (cbInstallment.Checked)
                        {
                            individualContribution.Amoount = decimal.Parse(txtInstallment.Value);
                            individualContribution.Status  = "Installment";
                        }

                        int insertInstallment = 0;
                        insertInstallment = mem.InsertIndividualContributionInstallment(individualContribution);
                        if (insertInstallment > 0)
                        {
                            ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackChecked();", true);

                            DALMembership dao            = new DALMembership();
                            int           contributionId = Convert.ToInt32(Session["ContributionID"]);
                            float         amountPaid     = dao.GetPartialPayment(contributionId);
                            hdnInstallment.Value = amountPaid.ToString();
                            hdnStatus.Value      = "Partial";
                            memfee.Disabled      = true;
                            txtInstallment.Value = amountPaid.ToString();
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedInstallmentFailure();", true);
                    }
                }
                else if (memfee.Disabled.Equals(false))
                {
                    if (cbInstallment.Checked.Equals(false))
                    {
                        if (!string.IsNullOrEmpty(individualContribution.DonorTier) && !string.IsNullOrEmpty(individualContribution.PaymentMode))
                        {
                            individualContribution.Amoount     = decimal.Parse(memfee.Value);
                            individualContribution.TotalAmount = decimal.Parse(memfee.Value);

                            if (cbInstallment.Checked)
                            {
                                individualContribution.Amoount = decimal.Parse(txtInstallment.Value);
                                individualContribution.Status  = "Installment";
                            }
                            int updateindcheck = mem.EditIndividual(individualContribution.DonorTier, individualContribution.ExpiryDate, individualID.Value, DateTime.Now);
                            createindcheck = mem.InsertIndividualContribution(individualContribution);

                            if (createindcheck > 0)
                            {
                                ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackCheckedNoInstallment();", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedFailure();", true);
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(individualContribution.DonorTier) && !string.IsNullOrEmpty(individualContribution.PaymentMode))
                        {
                            individualContribution.Amoount     = decimal.Parse(memfee.Value);
                            individualContribution.TotalAmount = decimal.Parse(memfee.Value);

                            if (cbInstallment.Checked)
                            {
                                individualContribution.Amoount = decimal.Parse(txtInstallment.Value);
                                individualContribution.Status  = "Installment";
                            }
                            int updateindcheck = mem.EditIndividual(individualContribution.DonorTier, individualContribution.ExpiryDate, individualID.Value, DateTime.Now);
                            createindcheck = mem.InsertIndividualContribution(individualContribution);
                            if (createindcheck > 0 && cbInstallment.Checked.Equals(true))
                            {
                                ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackCheckedFirst();", true);
                                // ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackCheckedWithInstallment();", true);
                            }
                        }
                        else
                        {
                            // hdnStatus.Value = "PartialFirst";
                            ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedInstallmentFailureFirst();", true);
                            //   ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedFailureWithInstallment();", true);
                        }
                    }
                }
            }
            else
            {
                //Update Membership Table if unchecked
                if (!string.IsNullOrEmpty(donortier))
                {
                    int indcheck = mem.EditIndividual(donortier, expiry_date, individualID.Value, DateTime.Now);
                    if (indcheck > 0)
                    {
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackUnchecked();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }
示例#13
0
        protected void Submit_Renewal(object sender, EventArgs e)
        {
            if (cbpaid.Checked)
            {
                int createorgcheck = 0;
                var expiry_date    = datetime.Value;
                var donortier      = Donor_Tier.Value;
                var dets           = memdets.Value;
                var paymentmode    = PaymentMode.Value;
                var paymentdate    = paymentreceiveddate.Value;

                dets = "Membership";
                if (!string.IsNullOrEmpty(donortier) && !string.IsNullOrEmpty(paymentmode))
                {
                    if (donortier == "Friend of IPS")
                    {
                        expiry_date = datetime.Value;
                    }
                    else if (donortier == "Lifetime Friend of IPS" || donortier == "Lifetime Benefactor of IPS" ||
                             donortier == "Lifetime Patron of IPS")
                    {
                        expiry_date    = "NA";
                        datetime.Value = expiry_date;
                    }

                    DALMembership mem = new DALMembership();
                    // individual
                    int updateorgcheck = mem.EditOrg(donortier, expiry_date, organisationID.Value, DateTime.Now);
                    createorgcheck = mem.InsertOrgContribution(organisationID.Value, decimal.Parse(memfee.Value), paymentdate, DateTime.Now, dets, PaymentMode.Value, remarks.Value);

                    if (createorgcheck == 0)
                    {
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackChecked();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "showControlsAfterPostBackCheckedFailure();", true);
                }
            }
            else
            {
                //Update Membership Table if unchecked
                var expiry_date = datetime.Value;
                var donortier   = Donor_Tier.Value;
                if (!string.IsNullOrEmpty(donortier))
                {
                    if (donortier == "Friend of IPS")
                    {
                        expiry_date = datetime.Value;
                    }
                    else if (donortier == "Lifetime Friend of IPS" || donortier == "Lifetime Benefactor of IPS" ||
                             donortier == "Lifetime Patron of IPS")
                    {
                        expiry_date    = "NA";
                        datetime.Value = expiry_date;
                    }

                    DALMembership mem = new DALMembership();

                    //individual
                    int orgcheck = mem.EditOrg(donortier, expiry_date, organisationID.Value, DateTime.Now);
                    if (orgcheck > 0)
                    {
                        //    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "displaySuccess('Successfully Renewed!');", true);
                        ScriptManager.RegisterStartupScript(Page, GetType(), "AlertDisplay", "showControlsAfterPostBackUnchecked();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, GetType(), "AlertFailureDisplay", "displayFailure();", true);
                }
            }
        }