示例#1
0
        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()));
        }
示例#2
0
        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));
        }
示例#3
0
        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)));
        }
示例#4
0
        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()
            }));
        }
示例#5
0
        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);
        }
示例#6
0
        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),
                });
            }
        }
示例#7
0
        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()
            }));
        }
示例#8
0
        public ActionResult MarketingAction(string urlName)
        {
            var action = MarketingActionService.FirstOrDefault(x => x.IsActive && x.UrlName == urlName);

            if (action == null)
            {
                return(null);
            }
            if (action.MarketingAction_ID == Specialist.Entities.Const.MarketingActions.Unlimit)
            {
                var button = SimplePageVMService.GetUnlimitOrderButton(Url, User);
                action.Description = TemplateEngine.GetText(action.Description, new { OrderButton = button.ToString() });
            }
            var page = action.IsSpecialOffer ? SimplePages.SpecialActions : SimplePages.MarketingActions;

            return(MView(Views.Center.MarketingAction, new MarketingActionVM {
                MarketingAction = action,
                MarketingActions = SimplePageService.GetAll().BySysName(page),
            }));
        }
示例#9
0
 public Tuple <int> ActionCount()
 {
     return(MethodBase.GetCurrentMethod().Cache(() => Tuple.Create(MarketingActionService.GetAll(x => x.IsActive).Count())));
 }