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 }))); }
private static string GetText(Func <IEnumerable <object> > entities, string text, HtmlHelper helper, string tag) { return(GetNewText(text, tag, () => Htmls.DefaultList(entities().Select( c => helper.GetLinkFor(c))))); }
public override object Get() { return(div[ h3[Url.SimpleTest().Details(Model.Test.Id, Model.Test.Name)], Model.Result.Text, br, Htmls.AddThis(null), br, HtmlHelper.Action <GroupController>(c => c.ForCourseTCList(Model.Result.Courses, false, 0)) ]); }
public override object Get() { return(div[Images.ClassRoom(Model.ClassRoomTC), h4["Свободные места"], Form(Url.Action <EditCartController>(c => c .EditSeatNumber(null)))[ Model.Available.Select(x => span[x, InputRadio(Model.For(y => y.Current), x.ToString()) .SetChecked(x == Model.Current)]), Hidden(Model.For(x => x.OrderDetailId), Model.OrderDetailId), Htmls.Submit("ok") ]].ToString()); }
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()))); }
/// <summary> /// 输出指定的提示信息 /// </summary> /// <param name="message">提示内容</param> /// <param name="title">标题</param> /// <param name="links">链拉 例:是,yes.htm|否,no.htm</param> /// <param name="url">跳转页面URL</param> /// <param name="showback">是否显示返回链接</param> public void Throw(string message, string title = "", string links = "", string url = "", bool showback = true) { HttpContext.Current.Response.ContentType = "text/html"; if (!string.IsNullOrWhiteSpace(links) && links.StartsWith("?")) { links = Req.GetPageName() + links; } var sb = new StringBuilder(template); sb.Replace("{$Message}", message); sb.Replace("{$Title}", string.IsNullOrWhiteSpace(title) ? "System Tips" : title); if (!string.IsNullOrWhiteSpace(links)) { var arr1 = links.Split('|'); foreach (var str in arr1) { var arr2 = str.Split(','); if (arr2.Length <= 1) { continue; } if (arr2[1].Trim() == "RefHref") { arr2[1] = Req.GetPrevious(); arr2[1] = Req.GetUrl(); } if (string.IsNullOrWhiteSpace(arr2[1])) { continue; } var s = ("<li><a href='" + arr2[1] + "'"); if (arr2.Length == 3) { s += (" target='" + arr2[2].Trim() + "'"); } if (arr2[0].Trim() == "RefText") { arr2[0] = Htmls.HtmlEncode(Req.GetPrevious()); } s += (">" + arr2[0].Trim() + "</a></li>\r\n\t\t\t\t"); sb.Replace("{$Links}", s + "{$Links}"); } } if (!string.IsNullOrWhiteSpace(url)) { var s = url == "back" ? "javascript:history.back()" : url; sb.Replace("{$AutoJump}", "<meta http-equiv='refresh' content='3; url=" + s + "' />"); } else { sb.Replace("{$AutoJump}", "<!-- no jump -->"); } sb.Replace("{$Links}", showback ? "<li><a href='javascript:history.back()'>Back Page</a></li>" : "<!-- no back -->"); Echo(sb.ToString()); End(); }
private static string GetTitle(SiteTerm model) { return(Htmls.CommonTitle(model.Name)); }
private static string GetTitle(Product model) { return(Htmls.CommonTitle(model.Name)); }
private static string GetTitle(VendorVM model) { return(Htmls.CommonTitle(model.Vendor.Name)); }