public static TagImg Employee(string employeeTC) { var image = Urls.Employee(employeeTC); if (image == null) { image = Urls.Employee("default"); } return(H.Img(image, employeeTC)); }
public static TagBuilder OrgResponse(OrgResponse response) { if (response.OriginalImg.IsEmpty()) { return(new NullTagBuilder()); } return(HtmlControls.Image( Urls.Image("Organization/ResponseOriginal/" + response.OriginalImg), "Отзыв компании: " + response.Organization.Name)); }
public static TagImg Image(string name) { var path = Urls.Image(name); if (path == null) { return(new NullTagImg()); } return(H.img.Src(path).Alt( Path.GetFileNameWithoutExtension(name))); }
public static TagImg ClassRoom(string classRoomTC) { var image = H.Img(Urls.ClassRoom(classRoomTC)); var size = Urls.GetSize(Urls.ClassRoomSys(classRoomTC)); if (size.HasValue) { image.Size(size.Value.Width, size.Value.Height); } return(image); }
public static TagBuilder UserPhoto(int userID) { var image = Urls.Image("User/Photo/" + userID + Urls.PhotoExt); if (image.IsEmpty()) { image = Urls.Image("User/Photo/default.jpg"); } return(HtmlControls.Image( image + "?" + DateTime.Now.Millisecond, userID.ToString()).Size(80, null)); }
public static TagBuilder Common(string name) { var image = HtmlControls.Image(Urls.Common(name), name); var size = Urls.GetSize(Urls.CommonSys(name)); if (size.HasValue) { image.Size(size.Value.Width, size.Value.Height); } return(image); }
public static TagImg Main(string name) { var size = Urls.GetSize(Urls.MainSys(name)); var tag = new TagImg().Src(Urls.Main(name)).Alt(""); if (size.HasValue) { tag.Size(size.Value.Width, size.Value.Height); } return(tag); }
public static TagImg NewsSmall(News news) { var newsSmall = "News/Small/" + news.SmallImage; var image = Image(newsSmall).Alt(news.Title); var size = Urls.GetSize(Urls.SysRoot + Urls.ImageFolder + newsSmall); if (size.HasValue) { image.Size(size.Value.Width, size.Value.Height); } return(image); }
public static string GetFileUrl(int fileID) { var directoryInfo = GetDirectoryInfo(fileID); if (!directoryInfo.Exists) { return(null); } var fileInfos = directoryInfo.GetFiles(); if (fileInfos.Length == 0) { return(null); } return(Urls.ContentRoot(GetInnerUserFilePath(fileID) + fileInfos[0].Name)); }
public static string SaveMessageImage(HttpFileCollectionBase files, int userID) { foreach (string file in files) { var hpf = files[file]; if (hpf.ContentLength == 0) { return(string.Empty); } var fileName = Path.GetFileName(hpf.FileName); var sysName = GetMessageFileSys(userID, fileName); SaveFileWithResize(hpf, sysName, 800); return(Urls.ContentRoot(Urls.FullMessageImage + userID + "/" + fileName)); } return(string.Empty); }
public static string Gallary(IEntityCommonInfo entity, bool withSlider = false, string folder = "Gallery", string filter = "") { var files = GetGallaryFiles(entity, folder); if (!files.Any()) { return(null); } var result = new List <string>(); if (!filter.IsEmpty()) { files = files.Where(x => x.Contains(filter)).ToList(); } var imageDescs = new ImageMetas().Descs(); foreach (var imageFile in files.Select(x => x.Replace('\\', '/')) .Where(x => !x.ToLowerInvariant().EndsWith("-s.jpg"))) { var imageUrl = Urls.SysToWeb(imageFile).ToLowerInvariant(); var smallImageUrl = GetSmallImageUrl(imageUrl); var name = Path.GetFileName(Path.GetDirectoryName(imageFile)) + "/" + Path.GetFileName(imageFile); var alt = imageDescs.GetValueOrDefault(name.ToLower()); var tagA = H.Anchor(imageUrl, H.Img(smallImageUrl).Alt(alt).ToString()) .Class("fancy-box").Rel("entity-fancy-box").Style("padding:5px"); result.Add(tagA.ToString()); } if (!withSlider || result.Count <= 3) { return(result.JoinWith("").Tag("div")); } return(CommonSiteHtmls.Carousel(result.CutInPartCount(3) .Select(x => H.span[x.JoinWith("")].Style("margin:0 20px").Class("fit-width-item")), true).ToString()); }
public static TagBuilder Root(string name) { return(HtmlControls.Image(Urls.Image(name), Path.GetFileNameWithoutExtension(name))); }
public static TagImg Section(string name) { return(H.img.Src(Urls.Image("Section/" + name + ".jpg")).Alt(name)); }
public static TagImg Indicator() { return(H.Img(Urls.Common("indicator.gif")).Class("ajax-indicator")); }
public static TagImg SeminarCert(decimal sigId) { return(H.Img(Urls.SysToWeb(UserImages.GetWebinarCertFileSys(sigId)))); }
public static TagBuilder AuthorizationType(string name) { return(HtmlControls.Image( Urls.Image("AuthorizationType/" + name + ".gif"), name)); }
// public static TagImg GroupCertVendor(decimal sigId) { // return H.Img(Urls.SysToWeb(UserImages.GetGroupCertVendorFileSys(sigId))); // } public static TagImg GroupCertEng(decimal sigId, bool vendor, bool ru) { return(H.Img(Urls.SysToWeb(UserImages.GetGroupCertEngFileSys(sigId, false, vendor, ru)))); }
public static TagBuilder Button(string name) { return(HtmlControls.Image(Urls.Button(name), name)); }
public static TagImg Course(string name) { var src = Urls.Image("Course/" + name + ".jpg"); return(H.Img(src)); }
public static TagBuilder MarketingActionSmall(MarketingAction marketingAction) { return(HtmlControls.Image( Urls.Image("MarketingAction/Small/" + marketingAction.UrlName + ".jpg"), marketingAction.Name)); }
public static TagBuilder Organization(Organization organization) { return(HtmlControls.Image( Urls.Image("Organization/Logo/" + organization.LogoImg), organization.Name)); }
public static TagBuilder Banner(string name, string alt) { return(HtmlControls.Image(Urls.Image("UsefulImages/" + name), alt)); }
public static TagImg Coupon(string urlName) { return(H.Img( Urls.Image("MarketingAction/Coupon/" + urlName + ".jpg"))); }
public static TagBuilder Submit(string name) { return(HtmlControls.ImgSubmit(Urls.Button(name), name) .Class("button")); }
// public static TagImg GroupCertEng(decimal sigId) { // return H.Img(Urls.SysToWeb(UserImages.GetGroupCertFileSys(sigId))); // } public static TagImg Best2016(decimal studentId) { return(H.Img(Urls.SysToWeb(UserImages.GetBest2016FileSys(studentId)))); }
public static TagBuilder Competitions(Competition competition) { return(HtmlControls.Image( Urls.Image("Competitions/" + competition.UrlName + ".jpg"), competition.Name)); }
public static TagInput SubmitImageButton(string name) { return(H.InputImage(Urls.Button(name)).Style("height:24px;")); }
public static TagBuilder UsefulInfomation(UsefulInformation usefulInformation) { return(HtmlControls.Image( Urls.Image("UsefulInformation/" + usefulInformation.UrlName + ".jpg"), usefulInformation.Name)); }
public static string Cdn(string file) { return(Common(Urls.JavaScript(file))); }
public static TagForm DeleteButton(string action) { return(H.Form(action)["<input onclick=\"return confirmDialog();\"" + " src='" + Urls.Main("del.gif") + "' title='Удалить' type=\"image\">"] .Style("display:inline;")); }