Пример #1
0
        public ActionResult GetSuggestedExpert(string pPinCode, double pRadius, int pCategoryId, int pSubCategoryId, int pPageIndex = 1)
        {
            List<User> lstUser = new List<Common.DTO.User>();
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            UserEngine userEngine = new UserEngine();
            string response = userEngine.GetExpertsByCatSubCatJSON(Request.Cookies["sessionkey"].Value, pPinCode, pRadius.ToString(), pCategoryId.ToString(), pSubCategoryId.ToString());
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            lstUser = (List<User>)Serializer.JSONStringToObject<List<User>>(responseObject.ResultObjectJSON);
            int totalRecords = responseObject.ResultObjectRecordCount;
            int totalPagesCount = 0;
            totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize);
            ViewBag.TotalPagesCount = totalPagesCount;
            ViewBag.TotalRecords = totalRecords;
            ViewBag.PageNumber = pPageIndex;
            return PartialView("_ExpertSuggestionList", lstUser);
            //List<UserViewModel> modelList = new List<UserViewModel>();

            //UserViewModel model = new UserViewModel();
            //model.UserID = 1;
            //model.FirstName = "Charles";
            //model.LastName = "Brown";
            //model.EmailID = "*****@*****.**";
            //model.ProfilePicPath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg";
            //model.Distance = "25.45 miles";
            //modelList.Add(model);

            //model = new UserViewModel();
            //model.UserID = 2;
            //model.FirstName = "Brendon";
            //model.LastName = "Taylor";
            //model.EmailID = "*****@*****.**";
            //model.ProfilePicPath = ServerSettings.WebApplicationURL + "/upload/profilepic/images.jpg";
            //model.Distance = "189.75 miles";
            //modelList.Add(model);

            //model = new UserViewModel();
            //model.UserID = 3;
            //model.FirstName = "Nathen";
            //model.LastName = "Astle";
            //model.EmailID = "*****@*****.**";
            //model.ProfilePicPath = ServerSettings.WebApplicationURL + "/upload/profilepic/chris_palmer_profile_11.jpg";
            //model.Distance = "356.79 miles";
            //modelList.Add(model);

            //int totalRecords = modelList.Count;
            //int totalPagesCount = 0;
            //totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize);

            //ViewBag.TotalPagesCount = totalPagesCount;
            //ViewBag.TotalRecords = totalRecords;
            //ViewBag.PageNumber = pPageIndex;

            //return PartialView("_ExpertSuggestionList", modelList);
        }