Beispiel #1
0
        public ActionResult CompanyAllReviewsByName(string id)
        {
            try
            {
                Session["calledPage"] = "R";

                CompanyViewModel companyViewModel = null;

                CompanyFilterEntity companyreviewsFilter = new CompanyFilterEntity
                {
                    CompanyName = id.Replace("-", " "),
                    Rows        = 0
                };

                companyViewModel = new CompanyService().GetUserReviews(companyreviewsFilter);
                if (companyViewModel != null && (companyViewModel.CompanyList != null && companyViewModel.CompanyList.Count > 0))
                {
                    companyViewModel.WebBaseURL = _webBaseURL;
                    return(View("~/Views/AllListPages/AllCompanyReviewsList.cshtml", companyViewModel));
                }
                else
                {
                    return(View("~/Views/Error/PageNotFound.cshtml"));
                }
            }
            catch (Exception)
            {
                return(null);
            }
        }
Beispiel #2
0
        public ActionResult Company()
        {
            try
            {
                Session["calledPage"] = "C";
                string           companyName      = Convert.ToString(Request.Url.Segments[2]).Trim();
                CompanyViewModel companyViewModel = null;
                if (companyName != string.Empty)
                {
                    Session["CompanyName"] = companyName;
                }
                if (CacheHandler.Exists(companyName.ToLower()))
                {
                    companyViewModel = new CompanyViewModel();
                    CacheHandler.Get(companyName.ToLower(), out companyViewModel);
                }
                else
                {
                    CompanyFilterEntity companyFilter = new CompanyFilterEntity
                    {
                        CompanyName  = companyName.Replace("-", " "),
                        MinRate      = 0,
                        MaxRate      = 0,
                        MinEmployee  = 0,
                        MaxEmployee  = 0,
                        SortBy       = "DESC",
                        FocusAreaID  = 0,
                        Location     = "0",
                        SubFocusArea = "0",
                        UserID       = Convert.ToInt32(Session["UserID"]),
                        PageNo       = 1,
                        PageSize     = 10,
                        OrderColumn  = 1
                    };

                    companyViewModel = new CompanyService().GetCompany(companyFilter);
                    CacheHandler.Add(companyViewModel, companyName);
                }

                companyViewModel.WebBaseURL = _webBaseURL;
                return(View(companyViewModel));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Beispiel #3
0
        public ActionResult CompanyAllPortfolioByName(string id)
        {
            Session["calledPage"] = "P";
            CompanyViewModel    companyViewModel     = null;
            CompanyFilterEntity companyreviewsFilter = new CompanyFilterEntity
            {
                CompanyName = id.Replace("-", " "),
                Rows        = 0
            };

            companyViewModel = new CompanyService().GetCompanyPortfolio(companyreviewsFilter);
            if (companyViewModel != null && (companyViewModel.CompanyList != null && companyViewModel.CompanyList.Count > 0))
            {
                companyViewModel.WebBaseURL = _webBaseURL;
                return(View("~/Views/AllListPages/AllPortFolioList.cshtml", companyViewModel));
            }
            else
            {
                return(View("~/Views/Error/PageNotFound.cshtml"));
            }
        }
Beispiel #4
0
        internal CompanySoftwareUserReviews GetUserReviewsForCompanyListingPage(CompanyFilterEntity UserReviewObj)
        {
            using (_httpClient = new HttpClient())
            {
                string        WebAPIURL   = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString();
                string        apiMethod   = "GetCompanyReviewsForListingPage";
                string        completeURL = WebAPIURL + apiMethod;
                StringContent httpContent = new StringContent(JsonConvert.SerializeObject(UserReviewObj), Encoding.UTF8, "application/json");

                HttpResponseMessage        response       = _httpClient.PostAsync(completeURL, httpContent).Result;
                CompanySoftwareUserReviews companyReviews = new CompanySoftwareUserReviews();
                if (response.IsSuccessStatusCode)
                {
                    companyReviews = JsonConvert.DeserializeObject <CompanySoftwareUserReviews>(response.Content.ReadAsStringAsync().Result);
                    return(companyReviews);
                }
                else
                {
                    return(companyReviews);
                }
            }
        }
Beispiel #5
0
        internal List <CompanyPortFolioEntity> GetCompanyPortfolioByID(CompanyFilterEntity companyPortfolioFilter)
        {
            using (_httpClient = new HttpClient())
            {
                string        WebAPIURL   = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString();
                string        apiMethod   = "GetAllCompanyPortfolioByID";
                string        completeURL = WebAPIURL + apiMethod;
                StringContent httpContent = new StringContent(JsonConvert.SerializeObject(companyPortfolioFilter), Encoding.UTF8, "application/json");

                HttpResponseMessage           response            = _httpClient.PostAsync(completeURL, httpContent).Result;
                List <CompanyPortFolioEntity> companyPortFolioObj = new List <CompanyPortFolioEntity>();
                if (response.IsSuccessStatusCode)
                {
                    companyPortFolioObj = JsonConvert.DeserializeObject <List <CompanyPortFolioEntity> >(response.Content.ReadAsStringAsync().Result);
                    return(companyPortFolioObj);
                }
                else
                {
                    return(companyPortFolioObj);
                }
            }
        }
        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));
        }
Beispiel #7
0
        internal CompanyViewModel GetCompany(CompanyFilterEntity companyFilter)
        {
            using (_httpClient = new HttpClient())
            {
                string WebAPIURL   = System.Configuration.ConfigurationManager.AppSettings["WebAPIURL"].ToString();
                string apiMethod   = "GetCompany";
                string completeURL = WebAPIURL + apiMethod + '/';

                StringContent httpContent = new StringContent(JsonConvert.SerializeObject(companyFilter), Encoding.UTF8, "application/json");

                HttpResponseMessage response         = _httpClient.PostAsync(completeURL, httpContent).Result;
                CompanyViewModel    companyViewModel = new CompanyViewModel();
                if (response.IsSuccessStatusCode)
                {
                    companyViewModel = JsonConvert.DeserializeObject <CompanyViewModel>(response.Content.ReadAsStringAsync().Result);
                    if (companyViewModel != null && companyViewModel.CompanyList.Count > 1)
                    {
                        StringBuilder sb = new StringBuilder();
                        foreach (CompanyEntity company in companyViewModel.CompanyList)
                        {
                            sb.Append(company.CompanyName + ",");
                        }

                        companyViewModel.CompanyFocusData = sb.ToString().TrimEnd(new char[] { ',' });

                        return(companyViewModel);
                    }
                    else
                    {
                        foreach (CompanyEntity company in companyViewModel.CompanyList)
                        {
                            if (companyFilter.CompanyName != "0")
                            {
                                if (company.CompanyFocus != null && company.CompanyFocus.Count > 0)
                                {
                                    companyViewModel.PrimaryCompanyFocus = company.CompanyFocus;
                                }

                                if (company.IndustialCompanyFocus != null && company.IndustialCompanyFocus.Count > 0)
                                {
                                    companyViewModel.IndustialCompanyFocus = company.IndustialCompanyFocus;
                                }

                                if (company.CompanyClientFocus != null && company.CompanyClientFocus.Count > 0)
                                {
                                    companyViewModel.CompanyClientFocus = company.CompanyClientFocus;
                                }

                                if (company.SubfocusNames != null && company.SubfocusNames.Count > 0)
                                {
                                    companyViewModel.SubfocusNames   = company.SubfocusNames;
                                    companyViewModel.CompanySubFocus = company.CompanySubFocus;
                                }

                                if (company.CompanyCompititors != null && company.CompanyCompititors.Count > 0)
                                {
                                    companyViewModel.CompanyCompititors = company.CompanyCompititors;
                                }
                            }
                        }

                        return(companyViewModel);
                    }
                }
                else
                {
                    return(companyViewModel);
                }
            }
        }
        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));
        }