コード例 #1
0
        private void PopulatePlanDetails(ListsManager lm)
        {
            Int16 typeid = (short)(mCustomer.LifeTimeActive ? 2 : 1);
            //populate limit drop down
            List<Limit> lstLimitTemp = lm.GetLimit(mCustomer.EnrollmentCode, typeid, mCustomer.MembershipInfo.StateId, mCustomer.Underwriter);
            List<decimal> lstLimit = (from l in lstLimitTemp
                                      orderby l.Amount
                                      select l.Amount
                                      ).ToList();

            ddlLimit.DataSource = lstLimit.Select(l => l.ToString("C0"));
            ddlLimit.DataBind();
            decimal LimitDefault = (from l in lstLimitTemp
                                    where l.IsDefault
                                    select l.Amount).FirstOrDefault();
            if (LimitDefault != 0)
                ddlLimit.SelectedValue = LimitDefault.ToString("C0");

            //populate remimbursement drop down
            List<Reimbursement> lstReimTemp = lm.GetReimbursement(mCustomer.EnrollmentCode, typeid);
            List<double> lstReim = (from l in lstReimTemp
                                    orderby l.Amount
                                    select l.Amount).ToList();
            ddlReimburse.DataSource = lstReim.Select(l => l.ToString("0%"));
            ddlReimburse.DataBind();
            double ReimDefault = (from l in lstReimTemp
                                  where l.IsDefault
                                  select l.Amount).FirstOrDefault();
            if (ReimDefault != 0)
                ddlReimburse.SelectedValue = ReimDefault.ToString("0%");

            //populate deductible drop down
            List<Deductible> lstDeductTemp = lm.GetDeductible(mCustomer.EnrollmentCode, typeid);
            List<decimal> lstDeductible = (from l in lstDeductTemp
                                           orderby l.Amount
                                           select l.Amount).ToList();
            ddlDeductible.DataSource = lstDeductible.Select(l => l.ToString("C0"));
            ddlDeductible.DataBind();

            //default
            decimal DeductDefault = (from l in lstDeductTemp
                                     where l.IsDefault
                                     select l.Amount).FirstOrDefault();
            if (DeductDefault != 0)
                ddlDeductible.SelectedValue = DeductDefault.ToString("C0");

            List<Rider> lstRider = lm.GetRider(mCustomer.EnrollmentCode, typeid);
            lstRiderList = lstRider;

            if (lstRider != null)
            {
                foreach (Rider r in lstRider)
                {
                    ddlRoutine.Items.Add(new ListItem(r.RiderName.Replace("Care ", "")));
                }

                ddlRoutine.DataBind();

            }

            ddlRoutine.Items.Insert(0, new ListItem("None", "0"));
        }
コード例 #2
0
 private void PopulateRiders(ListsManager lm)
 {
     dvRider.Visible = false;
     pnlBreeder.Visible = false;
     pnlHereditary.Visible = false;
     pnlPrescription.Visible = false;
     pnlRoutine.Visible = false;
     Int16 typeid = (short)(mCustomer.LifeTimeActive ? 2 : 1);
     List<Rider> lstRider = lm.GetRider(mCustomer.EnrollmentCode, typeid);
     List<Rider> lstRoutine = new List<Rider>();
     List<Rider> lstHereditary = new List<Rider>();
     foreach (Rider r in lstRider)
     {
         if (r.RiderName.Contains("Routine"))
         {
             pnlRoutine.Visible = true;
             ////kp:2015-05-04 retrieve quote - phase1 leftover item: sarah wants to have popover for each routine option
             //lstRoutine.Add(r);
             string routineName = r.RiderName;
             if (r.RiderName.Contains("125") && !r.RiderName.Contains("Rider Details"))
                 routineName = string.Concat(routineName, "&nbsp;&nbsp;", "<a class='rider-details' data-toggle='modal' data-target='#routine125' >Rider Details</a>");
             else if (r.RiderName.Contains("250") && !r.RiderName.Contains("Rider Details"))
                 routineName = string.Concat(routineName, "&nbsp;&nbsp;", "<a class='rider-details' data-toggle='modal' data-target='#routine250' >Rider Details</a>");
             else if (r.RiderName.Contains("400") && !r.RiderName.Contains("Rider Details"))
                 routineName = string.Concat(routineName, "&nbsp;&nbsp;", "<a class='rider-details' data-toggle='modal' data-target='#routine400' >Rider Details</a>");
             r.RiderName = routineName;
             lstRoutine.Add(r);
             ////end 2015-05-04
         }
         else if (r.RiderName.Contains("Hereditary"))
         {
             pnlHereditary.Visible = true;
             lstHereditary.Add(r);
         }
         else if (r.RiderName.Contains("Prescription"))
         {
             pnlPrescription.Visible = true;
         }
         else if (r.RiderName.Contains("Breeder"))
         {
             pnlBreeder.Visible = true;
         }
     }
     if (pnlRoutine.Visible)
     {
         lstRoutine.Add(new Rider { RiderName = "None", RiderValue = "0" });
         rblRoutine.DataSource = lstRoutine.OrderByDescending(t => t.RiderValue);
         rblRoutine.DataBind();
         rblRoutine.SelectedValue = "0";
     }
     if (pnlHereditary.Visible)
     {
         lstHereditary.Add(new Rider { RiderName = "None", RiderValue = "0" });
         rblHereditary.DataSource = lstHereditary.OrderByDescending(t => t.RiderValue);
         rblHereditary.DataBind();
         rblHereditary.SelectedValue = "0";
     }
     if (pnlBreeder.Visible || pnlHereditary.Visible || pnlPrescription.Visible || pnlRoutine.Visible)
         dvRider.Visible = true;
 }