public void AddControlForSpecialActions(SimplePageVM model) { var actions = MarketingActionService.GetAll().IsActive() .Where(a => a.IsSpecialOffer).OrderBy(a => a.WebSortOrder); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.ActionList, actions.ToList())); }
public ActionResult ActionsBlock() { var actions = MarketingActionService.GetAll().Where(ma => ma.IsAdvert && !ma.IsSecret && !ma.IsSpecialOffer) .IsActive() .OrderBy(x => x.WebSortOrder) .ToList(); return(View(Views.Shared.Block.ActionsBlock, actions)); }
public ActionResult Actions() { var actions = MarketingActionService.GetAll().IsActive() .Where(a => a.IsAdvert && !a.IsSecret && !a.IsSpecialOffer).OrderBy(a => a.WebSortOrder); var view = MHtmls.LongList(MHtmls.Title("Акции"), Html.Site().MobileActions(actions)); return(BaseView( new PagePart(view.ToString()), new PagePart(Views.Shared.Education.NearestGroupMobile, null))); }
public void AddControlForReserve(SimplePageVM model) { var reserve = MarketingActionService.GetAll().BySysName( MarketingActions.Reserve); model.Controls.Add( new SimplePageVM.Control(PartialViewNames.Reserve, new ReserveVM { Discounts = reserve .Discounts.Where(d => d.IsActive).ToList() })); }
public CertificationVM GetByUrlName(string urlName) { var certification = CertificationService.GetAll().ByUrlName(urlName); if (certification.IsNull()) { return(null); } var tracks = certification.Exams.SelectMany(e => e.Courses) .Where(c => c.IsTrack.GetValueOrDefault()).Distinct().ToList(); var trainers = EmployeeCertificationService.GetAll( x => x.Certification_ID == certification.Certification_ID && x.Certification.IsActive) .Select(x => x.Employee).Where(x => x.SiteVisible).Take(20).ToList(); var children = new List <Certification>(); if (!certification.Exams.Any()) { children = CertificationService.GetAll().IsActive() .Where(c => c.UrlName.StartsWith(certification.UrlName) && c.UrlName != certification.UrlName).OrderBy(x => x.SortOrder) .ToList(); } var groups = certification.Exams.Any() ? GetCertificationGroups(_.List(certification.Certification_ID)) : GetCertificationGroups(children.Select(x => x.Certification_ID).ToList()); var model = new CertificationVM { Certification = certification, Children = children, Tracks = TrackService.GetTrackDiscounts(tracks).ToList(), Groups = groups, Trainers = trainers }; if (model.IsMicrosoft) { model.Actions = MarketingActionService.GetAll(x => x.Type == MarketingActionType.Microsoft && !x.IsSecret && x.IsActive).ToList(); } return(model); }
public void AddGroupDiscount(List <Discount> discounts, OrderDetail orderDetail) { var isWebinar = PriceTypes.IsWebinar(orderDetail.PriceType_TC); var orderGroup = orderDetail.Group; var groupDiscount = (byte?)PriceService.GetGroupDiscount( orderGroup ?? new Group { Course_TC = orderDetail.Course_TC }, isWebinar); if (groupDiscount.HasValue) { discounts.Add(new Discount { PercentValue = groupDiscount, Discount_ID = Discounts.GroupId, MarketingAction = MarketingActionService.GetAll() .FirstOrDefault(x => x.SysName == MarketingActions.HotGroup), }); } }
public ActionResult MarketingActions() { //TODO: Спецпредложения https://spoint.specialist.ru/departments/projects/_layouts/listform.aspx?PageType=4&ListId={11B73C8A-2110-40C3-8169-06E92016FE8D}&ID=3435&ContentTypeID=0x010800B6F61EE8E28A8748843BA6EA5E5FB40A //this.StudentService.Get //User.St var actions = User.IsStudent //&& Students.Best2016.Contains(User.Student_ID.Value) ? MarketingActionService.GetAll(a => a.IsActive && a.IsAdvert && !a.IsSecret && !a.IsSpecialOffer && !a.IsOrg).OrderByDescending(x => x.UpdateDate).ToList() //&& x.MarketingAction_ID == Specialist.Entities.Const.MarketingActions.Best2016).ToList() : new List <MarketingAction>(); return(BaseView(Views.Center.MarketingActions, new MarketingActionsVM { Actions = actions.OrderBy(x => x.WebSortOrder).ToList() })); }
public Tuple <int> ActionCount() { return(MethodBase.GetCurrentMethod().Cache(() => Tuple.Create(MarketingActionService.GetAll(x => x.IsActive).Count()))); }