Exemplo n.º 1
0
        public JsonResult QueryConnectCareSponsors()
        {
            string draw          = CurrentRequestData.CurrentContext.Request["draw"];
            string echo          = CurrentRequestData.CurrentContext.Request["sEcho"];
            string displayLength = CurrentRequestData.CurrentContext.Request["iDisplayLength"];
            string displayStart  = CurrentRequestData.CurrentContext.Request["iDisplayStart"];

            string scrPolicynumber = CurrentRequestData.CurrentContext.Request["src_policynumber"];

            string fullname        = CurrentRequestData.CurrentContext.Request["scr_fullname"];
            string senttomatontine = CurrentRequestData.CurrentContext.Request["scr_senttomatontine"];
            string scruseDate      = CurrentRequestData.CurrentContext.Request["scr_useDate"];
            string scrFromDate     = CurrentRequestData.CurrentContext.Request["datepicker"];
            string scrToDate       = CurrentRequestData.CurrentContext.Request["datepicker2"];

            string search = CurrentRequestData.CurrentContext.Request["sSearch"];

            string displayLength2 = CurrentRequestData.CurrentContext.Request["iDisplayLength2"];
            int    toltareccount  = 0;
            int    totalinresult  = 0;

            DateTime fromdate = CurrentRequestData.Now;
            DateTime todate   = CurrentRequestData.Now;
            bool     usedate  = false;

            int senttotine = -1;

            int.TryParse(senttomatontine, out senttotine);


            IList <ConnectCareSponsor> queryresult = _helperSvc.QueryConnectCareSponsor(out toltareccount, out totalinresult, search, Convert.ToInt32(displayStart), Convert.ToInt32(displayLength), fullname, scrPolicynumber, senttotine, usedate, fromdate, todate);

            List <connectCareSponsorResponse> output = new List <connectCareSponsorResponse>();



            foreach (ConnectCareSponsor item in queryresult)
            {
                connectCareSponsorResponse obbb = new connectCareSponsorResponse();
                obbb.Sponsor       = item;
                obbb.beneficiaries = _helperSvc.GetBeneficiariesBySponsorID(item.Id);
                obbb.benecount     = obbb.beneficiaries.Count();
                output.Add(obbb);
            }
            JsonResult response = Json(output, JsonRequestBehavior.AllowGet);

            return(Json(new
            {
                sEcho = echo.ToString(),
                recordsTotal = toltareccount.ToString(),
                recordsFiltered = toltareccount.ToString(),
                iTotalRecords = toltareccount.ToString(),
                iTotalDisplayRecords = totalinresult.ToString(),
                aaData = response.Data
            }));
        }
Exemplo n.º 2
0
        public ActionResult ExpandSponsor(int Id, ExpandSponsorPage page)
        {
            ConnectCareSponsor             sponsor     = _helperSvc.GetSponsor(Id);
            IList <ConnectCareBeneficiary> beneficiary = _helperSvc.GetBeneficiariesBySponsorID(Id);


            if (sponsor != null)
            {
                connectCareSponsorResponse shii = new connectCareSponsorResponse()
                {
                    Sponsor       = sponsor,
                    beneficiaries = beneficiary,
                    benecount     = beneficiary.Count()
                };
                ViewBag.sponsor = shii;
            }



            return(View(page));
        }