public GenViewListByDistrictCode GetTestimonialByDistCode(string DistCode, int PageNo, int PageSize, string sTerm)
        {
            GenViewListByDistrictCode model = new GenViewListByDistrictCode();
            var parStart = new SqlParameter("@Start", (PageNo - 1) * PageSize);
            var parEnd   = new SqlParameter("@PageSize", PageSize);
            //return result;
            var parDistCode = new SqlParameter("@DistCode", DistCode);

            var parSearchTerm = new SqlParameter("@SearchTerm", DBNull.Value);

            if (!(sTerm == null || sTerm == ""))
            {
                parSearchTerm.Value = sTerm;
            }
            var spOutput = new SqlParameter
            {
                ParameterName = "@TotalCount",
                SqlDbType     = System.Data.SqlDbType.BigInt,
                Direction     = System.Data.ParameterDirection.Output
            };

            model.TestimonialsListByDist = db.Database.SqlQuery <GenTestimonialsByDist>("udspGetTestimonialSelectByDist @Start, @PageSize,@SearchTerm,@DistCode, @TotalCount out",
                                                                                        parStart, parEnd, parSearchTerm, parDistCode, spOutput).ToList();
            model.TotalRecords = int.Parse(spOutput.Value.ToString());

            return(model);
        }
Esempio n. 2
0
        public ActionResult CaseStudyListByDistrict(string DistCode, int PageNo = 1, int PageSize = 10, string searchTerm = "")
        {
            GenViewListByDistrictCode model = new GenViewListByDistrictCode();

            model.District   = ObjDist.GetDistByCode(DistCode);
            ViewBag.DistCode = DistCode;
            ViewBag.DistName = model.District.DistName;
            model            = ObjCaseStudy.GetCaseStudyByDistCode(DistCode, PageNo, PageSize, searchTerm);
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_pvCaseStudyListByDistrict", model));
            }
            return(View(model));
        }