Пример #1
0
 public ActionResult contact(int ID)
 {
     var company = CompanyService.Find(ID);
     if (company == null)
     {
         return HttpNotFound();
     }
     CompanyIndexViewModel model = new CompanyIndexViewModel();
     model.BannerImg = company.BannerImg;
     model.LogoImg = company.LogoImg;
     model.ID = company.MemberID;
     model.Name = company.Name;
     var cityIds = Utilities.GetIdList(company.CityCodeValue);
     var cityName = string.Join(" - ",
         CityCateService.GetALL()
         .Where(x => cityIds.Contains(x.ID))
         .ToList().Select(x => x.CateName));
     model.CityName = cityName;
     model.Description = company.Description;
     model.LinkMan = company.LinkMan;
     model.Sex = company.Sex;
     model.Lat = company.Lat;
     model.Lng = company.Lng;
     model.Mobile = company.Mobile;
     model.Phone = company.Phone;
     model.Address = company.Address;
     model.QQ = company.QQ;
     model.Categories = GetCompanyCategorise(ID);
     return View(model);
 }
Пример #2
0
        public ActionResult viewnotice(int ID, int noticeId)
        {
            var company = CompanyService.Find(ID);
            var notice = CompanyNoticeService.GetALL().SingleOrDefault(x => x.ID == noticeId && x.Status >= (int)CompanyNoticeStatus.ShowOnLine);
            if (company == null || notice == null)
            {
                return HttpNotFound();
            }
            CompanyIndexViewModel model = new CompanyIndexViewModel();
            model.BannerImg = company.BannerImg;
            model.LogoImg = company.LogoImg;
            model.ID = company.MemberID;
            model.Name = company.Name;
            var cityIds = Utilities.GetIdList(company.CityCodeValue);
            var cityName = string.Join(" - ",
                CityCateService.GetALL()
                .Where(x => cityIds.Contains(x.ID))
                .ToList().Select(x => x.CateName));
            model.CityName = cityName;
            model.Description = company.Description;
            model.LinkMan = company.LinkMan;
            model.Sex = company.Sex;
            model.Lat = company.Lat;
            model.Lng = company.Lng;
            model.Mobile = company.Mobile;
            model.Phone = company.Phone;
            model.QQ = company.QQ;
            model.Categories = GetCompanyCategorise(ID);
            model.Notice = notice;

            return View(model);
        }