예제 #1
0
        public ActionResult DetailNews(string id)
        {
            try
            {
                Session["calledPage"] = "N";
                OverviewNewsEntity NewsFilter = new OverviewNewsEntity
                {
                    CategoryID        = 0,
                    IsCompanySoftware = 0,
                    location          = "",
                    SubcategoryID     = "",
                    CompanySoftwareID = 0,
                    Title             = id
                };

                OverviewAndNewsService newsService   = new OverviewAndNewsService();
                OverviewNewsViewModel  newsViewModel = newsService.GetCompanySoftwareNews(NewsFilter);
                if (newsViewModel != null && (newsViewModel.OverviewNewsData != null && newsViewModel.OverviewNewsData.Count > 0))
                {
                    newsViewModel.Title = id.Replace("-", " ");
                    //newsViewModel.Title = id.FirstCharToUpper().Replace("-", " ");
                    return(View("~/Views/News/NewsDetail.cshtml", newsViewModel));
                }
                else
                {
                    return(View("~/Views/Error/PageNotFound.cshtml"));
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }