private ViewResult GetCancelView()
        {
            var pageRequiredData = new PageRequiredData(SectionId.No)
            {
                Title       = "Оплата отменена. Вы отменили оплату",
                Keywords    = "Оплата отменена, отмена оплаты пользователем",
                Description = "Оплата отменена. Вы отменили оплату. Пользователь отменил оплату"
            };
            var failPaymentModel = new FailPaymentModel(pageRequiredData, "Вы отменили оплату!");

            return(View("../Sales/FailPayment", failPaymentModel));
        }
        private ViewResult GetFailView()
        {
            var pageRequiredData = new PageRequiredData(SectionId.No)
            {
                Title       = "Оплата не пройдена. Не удалось оплатить",
                Keywords    = "Оплата не пройдена, неудачная оплата, непрошедший платеж",
                Description = "Оплата не пройдена. Не удалось оплатить"
            };
            var failPaymentModel = new FailPaymentModel(pageRequiredData, "Оплата не пройдена!");

            return(View("../Sales/FailPayment", failPaymentModel));
        }
        private void SetModel(string groupName, TrainerModel model)
        {
            var pageRequiredData = new PageRequiredData(SectionId.GroupByWords);

            pageRequiredData.Title       = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Title, groupName);
            pageRequiredData.Keywords    = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Keywords, groupName);
            pageRequiredData.Description = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Description, groupName);

            model.PageRequiredData = pageRequiredData;
            model.BreadcrumbsItems = BreadcrumbsHelper.GetWords(Url, groupName, pageRequiredData.Title);
            model.SetMarkUrl       = Url.Action("SetMark", RouteConfig.USER_TRAINER_GROUP_WORDS_CONTROLLER,
                                                new { group = groupName + "/" }, Request.Url.Scheme);
        }
Beispiel #4
0
        public ActionResult GetGapsTrainerView(GroupForUser group, Action <GapsTrainerModel> filler)
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            UserLanguages userLanguages = WebSettingsConfig.Instance.DefaultUserLanguages;
            List <SourceWithTranslation> sourceWithTranslation = GetSourceWithTranslations(userLanguages, group);

            var gapsTrainerHelper        = new GapsTrainerHelper();
            List <GapsTrainerItem> items = gapsTrainerHelper.ConvertToItems(sourceWithTranslation);

            var pageRequiredData = new PageRequiredData(SectionId, PageId.GapsTrainer, group.Name);
            var model            = new GapsTrainerModel(pageRequiredData, items);

            filler(model);
            return(View("GapsTrainer", model));
        }
        public ActionResult Index(long userId, UserLanguages userLanguages)
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.MyKnowledge))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            if (IsInvalid(userId, userLanguages))
            {
                return(RedirectToKnowledgeWall());
            }

            IUserRepetitionIntervalQuery userRepetitionIntervalQuery = CreateUserRepetitionIntervalQuery(userId,
                                                                                                         RepetitionType.
                                                                                                         All);

            var          trainerHelper = new TrainerHelper(userRepetitionIntervalQuery, userLanguages);
            TrainerModel model         = trainerHelper.GetTrainerModel(Request);

            var pageRequiredData = new PageRequiredData(SectionId.MyKnowledge);

            pageRequiredData.Title       = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Title, PageName);
            pageRequiredData.Keywords    = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Keywords, PageName);
            pageRequiredData.Description = WebSettingsConfig.Instance.GetTemplateText(pageRequiredData.SectionId, PageId.Cards, TemplateId.Description, PageName);
            model.PageRequiredData       = pageRequiredData;
            model.SetMarkUrl             = Url.Action("SetMark", ControllerName, null, Request.Url.Scheme);
            model.BreadcrumbsItems       = new List <BreadcrumbItem> {
                new BreadcrumbItem
                {
                    Title = "Стена знаний", Action = "Index", ControllerName = RouteConfig.USER_KNOWLEDGE_CONTROLLER
                },
                new BreadcrumbItem {
                    IsActive = true, Title = PageName
                }
            };
            if (EnumerableValidator.IsNullOrEmpty(model.Items))
            {
                return(RedirectToKnowledgeWall());
            }

            ViewData[OurHtmlHelper.ViewDataFlags.SKIP_POPUP_PANEL] = true;
            return(View("../Trainer/Index", model));
        }
        public ActionResult GapsTrainer(string group)
        {
            if (WebSettingsConfig.Instance.IsSectionForbidden(SectionId.VisualDictionary))
            {
                return(RedirectToAction("Index", RouteConfig.MAIN_CONTROLLER_NAME));
            }

            UserLanguages         userLanguages         = WebSettingsConfig.Instance.DefaultUserLanguages;
            RepresentationForUser representationForUser = GetRepresentationForUser(userLanguages, group);

            var gapsTrainerHelper        = new GapsTrainerHelper();
            List <GapsTrainerItem> items = gapsTrainerHelper.ConvertToItems(representationForUser.Areas);

            var pageRequiredData = new PageRequiredData(SectionId.VisualDictionary, PageId.GapsTrainer, group);
            var model            = new GapsTrainerModel(pageRequiredData, items);

            model.LoadNextBtnCaption = "Показать другие слова";
            model.SpeakerDataType    = SpeakerDataType.Word;
            model.BreadcrumbsItems   = BreadcrumbsHelper.GetVisualDictionary(Url, group, CommonConstants.FILL_GAPS);
            return(View("GapsTrainer", model));
        }
Beispiel #7
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="pageRequiredData">дополнительная необходимая информация для страницы</param>
 /// <param name="header">заголовок для страницы</param>
 public FailPaymentModel(PageRequiredData pageRequiredData,
                         string header)
 {
     PageRequiredData = pageRequiredData;
     Header           = header;
 }
Beispiel #8
0
 public GapsTrainerModel(PageRequiredData pageRequiredData, List <GapsTrainerItem> items)
 {
     PageRequiredData = pageRequiredData;
     Items            = items;
 }