예제 #1
0
        public ActionResult WithDiscount(string courseTC)
        {
            var groups = GroupService.GetGroupsForCourse(courseTC)
                         .Where(x => x.Discount.HasValue && !x.IsOpenLearning).ToList();

            var prices = PriceService.GetAllPricesForCourse(courseTC, null);

            var course      = CourseService.GetByPK(courseTC);
            var actionBlock = new PagePart(string.Empty);

            if (groups.Any(x => x.Discount == CommonConst.GoldFallDiscount))
            {
                actionBlock = new PagePart(
                    Htmls.HtmlBlock(HtmlBlocks.GoldFallLarge));
            }

            return(BaseView(
                       new PagePart(H.h3[Html.CourseLink(course)].ToString()),
                       actionBlock,
                       new PagePart(
                           Views.Shared.Education.NearestGroupList,
                           new GroupsWithDiscountVM(groups, true)
            {
                Course = course,
                Prices = prices
            })));
        }
예제 #2
0
        public ActionResult Credit(decimal id)
        {
            string xml;

            try {
                xml = AlphaBankGenerator.FromCredit(id);
            }
            catch (AlphaBankGenerator.CreditDataException e) {
                return(BaseViewWithTitle("Кредит недоступен", new PagePart(e.Message + "<br/>" + Htmls.HtmlBlock(HtmlBlocks.NoCredit))));
            }
            return(BaseView(new PagePart(H.div[H.Form("https://anketa.alfabank.ru/alfaform-pos/endpoint")[
                                                   H.textarea[xml].Name("InXML").Hide(),
                                                   H.Submit("Перейти к оформлению кредита")
                                               ].Id("form-credit").Enctype("application/x-www-form-urlencoded").Hide(),
                                               H.JQuery("$('#form-credit').submit()")
                                         ].ToString())));
        }