public ActionResult MetroBlock() { var complexes = GetComplexes(); return(Content(Htmls2.Menu2("Комплексы у метро") + Htmls2.MarkArrow(complexes.Select(x => Url.Locations() .Complex(x.UrlName, StringUtils.AngleBrackets(x.Name) + " " + x.Metro))))); }
public ActionResult MainPageSections() { var sections = SectionService.AllActiveSections().Where(x => x.ForMainPage) .OrderBy(x => x.WebSortOrder).ToList(); return(Content(Htmls2.MarkArrow(sections.Select(x => Html.SectionLink(x))).ToString())); }
public ActionResult CityInfoBlock(int id) { var block = CityInfoService.GetValues(id, x => x.Description); var model = new BaseVM { Title = "Блок города справа", RightSide = _.List(new PagePart(Htmls2.Cham(block))) }; return(ViewWithBaseVM(model)); }
public static string TrackPrice(this CommonCourseListItemVM courseListItemVM, string priceType, decimal?newPrice) { var realFullPrice = courseListItemVM.GetTrackFullPrice(priceType); var pt = PriceTypes.IsCorp(priceType) ? PriceTypes.Corporate : PriceTypes.Main; var ppPrice = courseListItemVM.GetTrackFullPrice(pt); var intraExtraFullPrice = newPrice * ((decimal)1.8); var fullPrice = PriceTypes.IsIntraExtra(priceType) ? (ppPrice > 0 && ppPrice <= intraExtraFullPrice ? OrderDetail.FloorToFifty(((decimal)ppPrice) * (decimal)0.95) : intraExtraFullPrice) : realFullPrice; return(Htmls2.OldNewPrice(fullPrice, newPrice)); }
public static string ShowCoursePrice(Tuple <decimal?, decimal?> price, decimal discount) { if (discount >= 100) { return(CommonTexts.FreeCourse); } if (discount > 0) { var coef = (1 - discount / 100); return(Htmls2.OldNewPrice(price.Item1, PriceUtils.GetPriceWithCoefficient(price.Item1, false, coef).Item1)); } return(Htmls2.OldNewPrice(price.Item2, price.Item1)); }
private static string GetWebinarPriceBlock(CourseBaseVM model) { var price = model.GetPrice(PriceTypes.Webinar); if (model.WebinarFinalDiscount > 0) { var postfix = model.WebinarDiscount > 0 ? "<br/>скидка {0}% {1}".FormatWith(model.WebinarFinalDiscount, DateTime.Today <= new DateTime(2015, 12, 31) ? "до 31 декабря" : "") : ""; return(Htmls2.DiscountPrice(model.WebinarFinalDiscount, price) + postfix); } return(price.MoneyString()); }
public override object Get() { var url = Links.CourseLinkAnchor(null, Model.Course).AbsoluteHref().GetHref(); var text = ("Чтобы принять участие в семинаре со скидкой {0}, " + "поделитесь ссылкой на него с друзьями в социальных сетях") .FormatWith(Htmls2.DiscountText("50%")); return(div[ JavaScript().Src("/Scripts/Views/Course/seminarsociallink.js?v=3"), Div("attention")[text, br, url], h3["Добавьте ссылку на Вашу публикацию в социальной сети:"], form.Action(Url.Cart().Urls.AddCourseWithSocialLinkPost(null))[ InputText("socialurl", "").Id("social-link-control").Style("width:400px;margin-bottom:10px;"), br, Submit("Добавить в корзину").Id("social-submit-button").SetDisabled(true)]]); }
public static object Videos(UrlHelper Url, List <Video> videos, bool showDescription = false) { if (!videos.Any()) { return(string.Empty); } Func <Video, TagTd> videoBlock = x => H.td.Class("new-video")[ Htmls2.YouTube(x, 200), x.AvailableEveryOne != null ? Convert.ToBoolean(x.AvailableEveryOne) == true ? H.p[Url.VideoLink(x)] : H.p[x.Name + " ", "<a href=\"/SimpleReg/Registration\")>Доступно после регистрации</a>"] : H.p[x.Name + " ", H.a.Href(Htmls2.BaseUrl() + "SimpleReg/Registration")["Доступно после регистрации"]], showDescription&& x.ShortDescription.IsEmpty() ? p[x.ShortDescription] : null]; return(H.table[ListUtils.GetRows(videos, 3).Select(y => H.tr[y.Select(videoBlock)])]); }
private TagTr CourseFourTr(IEnumerable <Group> groups) { if (groups.IsEmpty()) { return(null); } return(tr[ groups.Select(g => { var courseLink = Html.CourseLinkAnchor(g.Course); courseLink.Href(courseLink.GetHref() + "?src=anons"); return td.Style("width:50%").Valign("top")[ Images.Course(g.Course.UrlName) .Width(100).FloatLeft().ToString(), courseLink, br, span.Class("date")[g.DateBeg.DefaultString() + " " + Htmls2.Discount(g, true)], p.Style("font-size: 11px;")[ g.Course.AnnounceDescription] ]; }) ]); }
private TagList GetPriceRows(CourseBaseVM model, bool hasWebinar, bool hasIntraExtra, short?monDiscount) { var unlimitPrice = model.UnlimitPrice; var price = model.GetPrice(PriceTypes.PrivatePersonWeekend); var orgPrice = model.GetPrice(PriceTypes.Corporate); var intraExtraPrice = model.GetPrice(PriceTypes.IntraExtra); var intraExtraOrgPrice = model.GetPrice(PriceTypes.IntraExtraOrg); var orgTitle = "Организации"; if (CourseTC.MsVoucher.Contains(model.Course.Course_TC)) { orgTitle += br.ToString() + span["(Данный курс можно", br, "оплатить ваучерами ", br, Anchor("/news/2297", "Software Assurance"), ")"] .Style("font-size:10px;color:black;font-weight:normal;"); } var ppTitle = "Частные лица"; if (CourseTC.CiscoPrepay.Contains(model.Course.Course_TC)) { ppTitle += br.ToString() + span["По предоплате"] .Style("font-size:10px;color:grey;"); } var webinarPrice = model.GetPrice(PriceTypes.Webinar); Func <decimal?, string> getFirstPayment = x => x.HasValue ? (OrderDetail.FloorToFifty(x.Value * CommonConst.FirstPaymentPercent)).MoneyString() : null; var firstPayment = model.Course.IsTrackBool ? TableRow(td.Class("td_entrant")[Anchor(SimplePages.FullUrls.FirstPaymentNews, "Первый взнос (для частных лиц)").Style("color:red;")], td[getFirstPayment(price)], td[getFirstPayment(price)], hasIntraExtra ? td[getFirstPayment(intraExtraPrice)] : null, hasWebinar ? td[getFirstPayment(webinarPrice)] : null, unlimitPrice.HasValue ? td : null, td.Class("last_td")).Style("color:red;") : null; return (l( TableRow(td.Class("td_entrant")[ppTitle], td[Htmls2.DiscountPrice(monDiscount, price)], td[price.MoneyString()], hasIntraExtra ? td[intraExtraPrice.MoneyString()] : null, hasWebinar ? td[GetWebinarPriceBlock(model)] : null, unlimitPrice.HasValue ? td[ SimpleLinks.Unlimited(unlimitPrice > 0 ? unlimitPrice.MoneyString() : "Бесплатно")] : null, td.Class("last_td")[ Html.AddToCart(model.Course, priceTypeTC: PriceTypes.PrivatePersonWeekend)]), TableRow(td.Class("td_entrant")[orgTitle], td[orgPrice.MoneyString()], td[orgPrice.MoneyString()], hasIntraExtra ? td[intraExtraOrgPrice.MoneyString()] : null, hasWebinar ? td[model.GetPrice(PriceTypes.WebinarOrg).MoneyString()] : null, unlimitPrice.HasValue ? td[""] : null, td.Class("last_td")[ Html.AddToCart(model.Course, priceTypeTC: PriceTypes.Corporate)]), firstPayment )); }
public static TagDiv VimeoPlayers(List <string> videoIds, string pwd) { return(H.div[ H.p[H.b["Пароль: "], pwd], videoIds.Select(x => H.div[Htmls2.Vimeo(x)].Style("padding-bottom:10px;"))]); }
public TagDiv MobileCourseGroups(List <Group> groups) { if (!groups.Any()) { return(null); } return(H.div.Id("groups")[ H.h3["Ближайшие группы:"], groups.Select(g => H.Div("group")[ Url.Link <CourseController>(c => c.Group(g.Group_ID), l(span.Class("coursedate")[g.DateInterval], span.Class("coursetime")[g.TimeInterval + ";" + g.DaySequence + (g.IsOpenLearning ? ";Открытое Обучение" : "")], span.Class("courseplace")[ "УК " + StringUtils.AngleBrackets( g.Complex.GetOrDefault(x => x.Name))], Raw(Htmls2.Discount(g, true))))]) ]); }
public TagDiv MobileGroups(List <Group> groups) { if (!groups.Any()) { return(null); } return(H.div.Id("groups")[ H.h3["Ближайшие группы:"], groups.Select(g => H.Div("group")[ Url.Link <CourseController>(c => c.Group(g.Group_ID), l(span.Class("date")[g.DateBeg.DefaultString()], span.Class("groupName")[g.Course.GetName()], Raw(Htmls2.Discount(g, true))))]) ]); }