public ActionResult GetOverViewNewsForSoftware(SoftwareViewModel softwaremodel) { try { int SoftwareCategoryID = 0; if (Session["SoftwareCategory"] != null) { SoftwareCategoryID = new FocusAreaService().GetSoftwareCategoryID(Session["SoftwareCategory"].ToString()); } OverviewNewsEntity NewsFilter = new OverviewNewsEntity { CategoryID = SoftwareCategoryID, IsCompanySoftware = 2, location = "", SubcategoryID = "", CompanySoftwareID = 0 }; OverviewAndNewsService newsService = new OverviewAndNewsService(); OverviewNewsViewModel newsViewModel = newsService.GetCompanySoftwareNews(NewsFilter); return(PartialView("~/Views/SoftwareList/_SoftwareNewsList.cshtml", newsViewModel)); } catch (Exception ex) { return(null); } }
public ActionResult GetOverViewNewsForService(CompanyViewModel companymodel) { try { int focusAreaID = 0; if (Session["FocusAreaName"] != null) { focusAreaID = new FocusAreaService().GetFocusAreaID(Session["FocusAreaName"].ToString()); } OverviewNewsEntity NewsFilter = new OverviewNewsEntity { CategoryID = focusAreaID, IsCompanySoftware = 1, location = companymodel.Location == "0" ? "" : companymodel.Location, SubcategoryID = companymodel.SubFocusArea, CompanySoftwareID = 0 }; OverviewAndNewsService newsService = new OverviewAndNewsService(); OverviewNewsViewModel newsViewModel = newsService.GetCompanySoftwareNews(NewsFilter); return(PartialView("~/Views/CompanyList/_CompanyNewsList.cshtml", newsViewModel)); } catch (Exception ex) { return(null); } }
public JsonResult GetFocusArea() { dynamic jsonResult = default(dynamic); try { List <FocusAreaEntity> focusAreaList = new FocusAreaService().GetFocusAreas(); jsonResult = new { focusAreaList }; } catch (Exception) { } return(Json(jsonResult, JsonRequestBehavior.AllowGet)); }
// GET: CompanyList public ActionResult SoftwareList(string id) { Session["calledPage"] = "S"; var urlSoftwareCategory = Convert.ToString(Request.Url.Segments[1]); var softwareService = new SoftwareService(); var softwareCategoryId = 0; if (Request.Url.Segments.Length > 2) { urlSoftwareCategory = urlSoftwareCategory.Replace("/", ""); } if (urlSoftwareCategory != string.Empty) { Session["SoftwareCategory"] = urlSoftwareCategory.ToString(); softwareCategoryId = new FocusAreaService().GetSoftwareCategoryID(urlSoftwareCategory); } SoftwareFilterEntity softwareFilter = new SoftwareFilterEntity { SoftwareName = "", SoftwareCategoryId = softwareCategoryId, PageNo = 1, PageSize = 25, SortBy = "DESC", UserID = Convert.ToInt32(Session["UserID"]), OrderColumn = 1, }; SoftwareViewModel softwareViewModel = softwareService.GetSoftware(softwareFilter); softwareViewModel.WebBaseUrl = _webBaseUrl; GetSoftwareCategoryHeadLine(urlSoftwareCategory, softwareViewModel); softwareViewModel.SoftwareCategoryId = softwareCategoryId.ToString(); softwareViewModel.PageCount = 0; softwareViewModel.PageNumber = 1; softwareViewModel.PageIndex = 1; softwareViewModel.TotalNoOfSoftwares = softwareViewModel.SoftwareList.Select(a => a.TotalCount).FirstOrDefault(); if (softwareViewModel.SoftwareList.Count > 0) { softwareViewModel.PageCount = (softwareViewModel.SoftwareList[0].TotalCount + 25 - 1) / 25; } return(View(softwareViewModel)); }
public JsonResult GetDataForAutoComplete() { try { var jsonResult = default(dynamic); string searchTerm = Convert.ToString(Request.Params["starts_with"]); int SoftwareCategory = new FocusAreaService().GetSoftwareCategoryID(Convert.ToString(Session["SoftwareCategory"])); List <string> myAutoCompleteList = new SoftwareService().GetSoftwareForAutoComplete(SoftwareCategory, searchTerm); jsonResult = from a in myAutoCompleteList select new { Name = a }; return(Json(jsonResult, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(null); } }
public JsonResult GetDataForAutoComplete(int type) { try { var jsonResult = default(dynamic); string searchTerm = Convert.ToString(Request.Params["starts_with"]); int focusAreaID = new FocusAreaService().GetFocusAreaID(Convert.ToString(Session["FocusAreaName"])); List <string> myAutoCompleteList = new CompanyService().GetDataForAutoComplete(type, focusAreaID, searchTerm); jsonResult = from a in myAutoCompleteList select new { Name = a }; return(Json(jsonResult, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(null); } }
public ActionResult GetSoftwareUserReviews(string softwarename, int PageSize) { int SoftwareCategoryID = 0; if (Session["SoftwareCategory"] != null) { SoftwareCategoryID = new FocusAreaService().GetSoftwareCategoryID(Session["SoftwareCategory"].ToString()); } SoftwareFilterEntity UserReviewObj = new SoftwareFilterEntity { SoftwareCategoryId = SoftwareCategoryID, SoftwareName = softwarename, PageNo = 1, PageSize = PageSize }; CompanySoftwareUserReviews companyReViewModel = new CompanySoftwareUserReviews(); companyReViewModel = new SoftwareService().GetUserReviewsForSoftwareListingPage(UserReviewObj); return(PartialView("~/Views/SoftwareList/_SoftwareUsersReviewsList.cshtml", companyReViewModel)); }
public ActionResult GetUserReviews(string companyname, int PageSize) { int focusAreaID = 0; if (Session["FocusAreaName"] != null) { focusAreaID = new FocusAreaService().GetFocusAreaID(Session["FocusAreaName"].ToString()); } CompanyFilterEntity UserReviewObj = new CompanyFilterEntity { FocusAreaID = focusAreaID, CompanyName = companyname, PageNo = 1, PageSize = PageSize }; CompanySoftwareUserReviews companyReViewModel = new CompanySoftwareUserReviews(); companyReViewModel = new CompanyService().GetUserReviewsForCompanyListingPage(UserReviewObj); return(PartialView("~/Views/CompanyList/_UsersReviewsList.cshtml", companyReViewModel)); }
public ActionResult CompanySubCategoryList(string id) { Session["calledPage"] = "L"; string urlFocusAreaName = Convert.ToString(Request.Url.Segments[1]); string urlSubFocusAreaName = Convert.ToString(Request.Url.Segments[2]); int focusAreaID = 0; if (Request.Url.Segments.Length > 2) { urlFocusAreaName = urlFocusAreaName.Replace("/", ""); urlSubFocusAreaName = urlSubFocusAreaName.Replace("/", ""); Session["FocusAreaName"] = urlFocusAreaName.ToString(); Session["SubFocusAreaName"] = urlSubFocusAreaName.ToString(); focusAreaID = new FocusAreaService().GetFocusAreaID(urlFocusAreaName); } CompanyService companyService = new CompanyService(); if (string.IsNullOrEmpty(id)) { id = "0"; Session["Country"] = ""; } else { Session["Country"] = id; id = id.Replace("-", "space"); } CompanyFilterEntity companyFilter = new CompanyFilterEntity { CompanyName = "0", MinRate = 0, MaxRate = 0, MinEmployee = 0, MaxEmployee = 0, SortBy = "DESC", FocusAreaID = focusAreaID, Location = id, SubFocusArea = urlSubFocusAreaName, UserID = Convert.ToInt32(Session["UserID"]), PageNo = 1, PageSize = 25, OrderColumn = 1 }; CompanyViewModel companyViewModel = companyService.GetCompany(companyFilter); companyViewModel.WebBaseURL = _webBaseURL; GetCategoryHeadLine(urlFocusAreaName, companyViewModel, id.Replace("space", " "), urlSubFocusAreaName); companyViewModel.SubFocusArea = urlSubFocusAreaName; companyViewModel.Location = id; companyViewModel.PageCount = 0; companyViewModel.PageNumber = 1; companyViewModel.PageIndex = 1; companyViewModel.TotalNoOfCompanies = companyViewModel.CompanyList.Select(a => a.TotalCount).FirstOrDefault(); if (companyViewModel.CompanyList.Count > 0) { companyViewModel.AverageUserRating = 4; companyViewModel.TotalNoOfUsers = 10; companyViewModel.PageCount = (companyViewModel.CompanyList[0].TotalCount + 25 - 1) / 25; } Session["CompanyNames"] = companyViewModel.CompanyFocusData; return(View("~/Views/CompanyList/CompanyList.cshtml", companyViewModel)); }
public ActionResult CompanyList(string companyID, decimal minRate, decimal maxRate, int minEmployee, int maxEmployee, string sortby, string location, string subFocusArea, int PageNo, int PageSize, int FirstPage, int LastPage, int OrderColumn) { CompanyService companyService = new CompanyService(); string urlFocusAreaName = Convert.ToString(Session["FocusAreaName"]); if (location != "0") { location = location.Replace("-", "space"); } int focusAreaID = new FocusAreaService().GetFocusAreaID(urlFocusAreaName); CompanyFilterEntity companyFilter = new CompanyFilterEntity { CompanyName = companyID, MinRate = minRate, MaxRate = maxRate, MinEmployee = minEmployee, MaxEmployee = maxEmployee, SortBy = sortby, FocusAreaID = focusAreaID, Location = location, SubFocusArea = subFocusArea, UserID = Convert.ToInt32(Session["UserID"]), PageNo = PageNo, PageSize = PageSize, OrderColumn = OrderColumn }; CompanyViewModel companyViewModel = companyService.GetCompany(companyFilter); companyViewModel.WebBaseURL = _webBaseURL; companyViewModel.PageCount = 0; companyViewModel.PageNumber = PageNo; companyViewModel.PageIndex = 1; if (companyViewModel.CompanyList.Count > 0) { companyViewModel.PageCount = (companyViewModel.CompanyList[0].TotalCount + PageSize - 1) / PageSize; } if ((PageNo == FirstPage || PageNo == LastPage) && LastPage >= 5) { if (PageNo == FirstPage && PageNo != 1) { companyViewModel.PageIndex = FirstPage - 1; } else if (PageNo == LastPage) { if (PageNo == companyViewModel.PageCount) { companyViewModel.PageIndex = (PageNo - 5) + 1; } else { companyViewModel.PageIndex = FirstPage + 1; } } } else if (PageNo > LastPage && LastPage >= 5) { companyViewModel.PageIndex = (PageNo - 5) + 1; } else if (PageNo >= FirstPage && PageNo <= LastPage) { companyViewModel.PageIndex = FirstPage; } Session["CompanyNames"] = companyViewModel.CompanyFocusData; return(PartialView("_CompList", companyViewModel)); }