/// <summary> /// Initial Listing of a user problem /// </summary> /// <returns></returns> public ActionResult Problem() { ViewBag.ActiveMenu = "LiDashboard"; ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); DashboardObject dashboardobj = new DashboardObject(); ProblemEngine probEngine = new ProblemEngine(); string response = probEngine.GetProblemsByUserIDJSON(Request.Cookies["sessionkey"].Value, "1", _PageSize.ToString(), false, "1"); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if(responseObject.ResultMessage == "ERROR") { } dashboardobj = (DashboardObject)Serializer.JSONStringToObject<DashboardObject>(responseObject.ResultObjectJSON); ViewBag.NextPageIndex = 2; ViewBag.ProblemStatusId = new SelectList(dashboardobj.ProblemStatus, "ProblemStatusID", "ProblemStatusName"); ViewBag.CompanyID = new SelectList(dashboardobj.Companies, "CompanyID", "CompanyName"); ViewBag.CategoryID = new SelectList(dashboardobj.Categories, "ID", "Name"); ViewBag.CategoryPageSize = CategoryPageSize; if (Request.Url.AbsolutePath.ToLower().Contains("myresolution")) ViewBag.ActiveMenu = "LiMyResolution"; int totalPagesCount = (int)Math.Ceiling((float)responseObject.ResultObjectRecordCount / (float)_PageSize); ViewBag.TotalPagesCount = totalPagesCount; ViewBag.PageNumber = 1; ViewBag.TotalRecordCount = responseObject.ResultObjectRecordCount; return View(dashboardobj); //int totalRecords = 0; //ViewBag.ActiveMenu = "LiDashboard"; //UserDashboardComlexViewModel model = new UserDashboardComlexViewModel(); //ProblemListViewModel problemModel = new ProblemListViewModel(); //model.ProblemListViewModel = new List<ProblemListViewModel>(); //problemModel.ProblemID = 1; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 4; //problemModel.ProblemVideoCount = 2; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/upload/problem-image/1.JPG"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //problemModel.Latitude = "27.140717"; //problemModel.Logitude = "78.030954"; //model.ProblemListViewModel.Add(problemModel); //problemModel = new ProblemListViewModel(); //problemModel.ProblemID = 2; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 5; //problemModel.ProblemVideoCount = 7; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/assets/img/images%20(7).jpg"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //problemModel.Latitude = "26.604125"; //problemModel.Logitude = "76.108800"; //model.ProblemListViewModel.Add(problemModel); //problemModel = new ProblemListViewModel(); //problemModel.ProblemID = 3; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 5; //problemModel.ProblemVideoCount = 7; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/upload/problem-image/5.JPG"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //problemModel.Latitude = "23.383021"; //problemModel.Logitude = "69.621456"; //model.ProblemListViewModel.Add(problemModel); //problemModel = new ProblemListViewModel(); //problemModel.ProblemID = 4; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 5; //problemModel.ProblemVideoCount = 7; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/upload/problem-image/8.JPG"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //problemModel.Latitude = "24.359854"; //problemModel.Logitude = "87.420752"; //model.ProblemListViewModel.Add(problemModel); //if (Request.Url.AbsolutePath.ToLower().Contains("myproblems")) //{ // ViewBag.ActiveMenu = "LiMyProblems"; //} //if (model.ProblemListViewModel.Count > 0) //{ // totalRecords = 2; //} //int totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize); //ViewBag.TotalPagesCount = totalPagesCount; //ViewBag.PageNumber = 1; //ViewBag.TotalRecordCount = 4; //RecentProblemResolutionViewModel recentProblemModel = null; //recentProblemModel = new RecentProblemResolutionViewModel(); //recentProblemModel.ProblemID = 1; //recentProblemModel.ProblemImagePath = ServerSettings.WebApplicationURL + "/upload/problem-image/1.jpg"; //recentProblemModel.ProblemTitle = "Washing Machine"; //recentProblemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.RecentProblemResolutionList.Add(recentProblemModel); //recentProblemModel = new RecentProblemResolutionViewModel(); //recentProblemModel.ProblemID = 2; //recentProblemModel.ProblemImagePath = ServerSettings.WebApplicationURL + "/upload/problem-image/2.jpg"; //recentProblemModel.ProblemTitle = "Freezer Cooling"; //recentProblemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.RecentProblemResolutionList.Add(recentProblemModel); //recentProblemModel = new RecentProblemResolutionViewModel(); //recentProblemModel.ProblemID = 3; //recentProblemModel.ProblemImagePath = ServerSettings.WebApplicationURL + "/upload/problem-image/3.jpg"; //recentProblemModel.ProblemTitle = "Ac power supply"; //recentProblemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.RecentProblemResolutionList.Add(recentProblemModel); //recentProblemModel = new RecentProblemResolutionViewModel(); //recentProblemModel.ProblemID = 4; //recentProblemModel.ProblemImagePath = ServerSettings.WebApplicationURL + "/upload/problem-image/4.jpg"; //recentProblemModel.ProblemTitle = "Washing Machine"; //recentProblemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.RecentProblemResolutionList.Add(recentProblemModel); //recentProblemModel = new RecentProblemResolutionViewModel(); //recentProblemModel.ProblemID = 5; //recentProblemModel.ProblemImagePath = ServerSettings.WebApplicationURL + "/upload/problem-image/5.jpg"; //recentProblemModel.ProblemTitle = "Acc Cooling"; //recentProblemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.RecentProblemResolutionList.Add(recentProblemModel); //List<DropDownViewModel> categoryList = new List<DropDownViewModel>(); //categoryList.Add(new DropDownViewModel { Name = "Television", ID = 1 }); //categoryList.Add(new DropDownViewModel { Name = "Refrigerator", ID = 2 }); //categoryList.Add(new DropDownViewModel { Name = "Air Conditioner", ID = 3 }); //categoryList.Add(new DropDownViewModel { Name = "Microwave oven", ID = 4 }); //model.CategoryList = categoryList; //ViewBag.CategoryPageSize = CategoryPageSize; //ViewBag.NextPageIndex = 2; //return View(model); }
public ActionResult GetProblemByPaging(int pPageIndex, string pFilterBy = "") { //ViewBag.ActiveMenu = pActiveMenu; int startindex = 0; if (pPageIndex == 1) startindex = 1; else startindex = pPageIndex + 9; DashboardObject dashboardObject = new DashboardObject(); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); ProblemEngine probEngine = new ProblemEngine(); string response = probEngine.GetProblemsByUserIDJSON(Request.Cookies["sessionkey"].Value, startindex.ToString(), pPageIndex.ToString(), true, pFilterBy); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); dashboardObject = (DashboardObject)Serializer.JSONStringToObject<DashboardObject>(responseObject.ResultObjectJSON); if (Request.Url.AbsolutePath.ToLower().Contains("myresolution")) ViewBag.ActiveMenu = "LiMyResolution"; int totalPagesCount = (int)Math.Ceiling((float)responseObject.ResultObjectRecordCount / (float)_PageSize); ViewBag.TotalPagesCount = totalPagesCount; ViewBag.PageNumber = pPageIndex; ViewBag.ProblemStatusId = new SelectList(dashboardObject.ProblemStatus, "ProblemStatusID", "ProblemStatusName"); ViewBag.TotalRecordCount = responseObject.ResultObjectRecordCount; ViewBag.NextPageIndex = pPageIndex + 1; return PartialView("_ProblemList", dashboardObject.ProblemList); //int totalRecords = 0; //UserDashboardComlexViewModel model = new UserDashboardComlexViewModel(); //ViewBag.NextPageIndex = 2; //ViewBag.CategoryPageSize = CategoryPageSize; //ViewBag.NextPageIndex = 2; //ViewBag.CategoryPageSize = CategoryPageSize; //ProblemListViewModel problemModel = new ProblemListViewModel(); //model.ProblemListViewModel = new List<ProblemListViewModel>(); //problemModel.ProblemID = 1; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 4; //problemModel.ProblemVideoCount = 2; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/assets/img/images%20(7).jpg"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.ProblemListViewModel.Add(problemModel); //problemModel = new ProblemListViewModel(); //problemModel.ProblemID = 2; //problemModel.Address1 = "15-c/shubham flats"; //problemModel.Address2 = "citylight"; //problemModel.Address3 = "Near JodhpurChar rasta"; //problemModel.City = "Ahmedabad"; //problemModel.State = "Gujarat"; //problemModel.Country = "India"; //problemModel.Pincode = "666-0444-02"; //problemModel.ProblemImageCount = 5; //problemModel.ProblemVideoCount = 7; //problemModel.ProblemTitle = "Washing Machine"; //problemModel.ProblemImageName = "~/assets/img/images%20(7).jpg"; //problemModel.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //model.ProblemListViewModel.Add(problemModel); ////if (Request.Url.AbsolutePath.ToLower().Contains("myproblems")) ////{ //// ViewBag.ActiveMenu = "LiMyProblems"; ////} //if (model.ProblemListViewModel.Count > 0) //{ // totalRecords = 2; //} //int totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize); //ViewBag.TotalPagesCount = totalPagesCount; //ViewBag.PageNumber = pPageIndex; //ViewBag.TotalRecordCount = 4; //return PartialView("_ProblemList", model.ProblemListViewModel); }