Beispiel #1
0
        public static TagImg Employee(string employeeTC)
        {
            var image = Urls.Employee(employeeTC);

            if (image == null)
            {
                image = Urls.Employee("default");
            }
            return(H.Img(image, employeeTC));
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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)));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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));
        }
Beispiel #10
0
 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);
 }
Beispiel #11
0
        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());
        }
Beispiel #12
0
 public static TagBuilder Root(string name)
 {
     return(HtmlControls.Image(Urls.Image(name),
                               Path.GetFileNameWithoutExtension(name)));
 }
Beispiel #13
0
 public static TagImg Section(string name)
 {
     return(H.img.Src(Urls.Image("Section/" + name + ".jpg")).Alt(name));
 }
Beispiel #14
0
 public static TagImg Indicator()
 {
     return(H.Img(Urls.Common("indicator.gif")).Class("ajax-indicator"));
 }
Beispiel #15
0
 public static TagImg SeminarCert(decimal sigId)
 {
     return(H.Img(Urls.SysToWeb(UserImages.GetWebinarCertFileSys(sigId))));
 }
Beispiel #16
0
 public static TagBuilder AuthorizationType(string name)
 {
     return(HtmlControls.Image(
                Urls.Image("AuthorizationType/" + name + ".gif"), name));
 }
Beispiel #17
0
//		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))));
        }
Beispiel #18
0
 public static TagBuilder Button(string name)
 {
     return(HtmlControls.Image(Urls.Button(name), name));
 }
Beispiel #19
0
        public static TagImg Course(string name)
        {
            var src = Urls.Image("Course/" + name + ".jpg");

            return(H.Img(src));
        }
Beispiel #20
0
 public static TagBuilder MarketingActionSmall(MarketingAction marketingAction)
 {
     return(HtmlControls.Image(
                Urls.Image("MarketingAction/Small/" + marketingAction.UrlName + ".jpg"),
                marketingAction.Name));
 }
Beispiel #21
0
 public static TagBuilder Organization(Organization organization)
 {
     return(HtmlControls.Image(
                Urls.Image("Organization/Logo/" + organization.LogoImg), organization.Name));
 }
Beispiel #22
0
 public static TagBuilder Banner(string name, string alt)
 {
     return(HtmlControls.Image(Urls.Image("UsefulImages/" + name), alt));
 }
Beispiel #23
0
 public static TagImg Coupon(string urlName)
 {
     return(H.Img(
                Urls.Image("MarketingAction/Coupon/" + urlName + ".jpg")));
 }
Beispiel #24
0
 public static TagBuilder Submit(string name)
 {
     return(HtmlControls.ImgSubmit(Urls.Button(name), name)
            .Class("button"));
 }
Beispiel #25
0
//		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))));
        }
Beispiel #26
0
 public static TagBuilder Competitions(Competition competition)
 {
     return(HtmlControls.Image(
                Urls.Image("Competitions/" + competition.UrlName + ".jpg"),
                competition.Name));
 }
Beispiel #27
0
 public static TagInput SubmitImageButton(string name)
 {
     return(H.InputImage(Urls.Button(name)).Style("height:24px;"));
 }
Beispiel #28
0
 public static TagBuilder UsefulInfomation(UsefulInformation usefulInformation)
 {
     return(HtmlControls.Image(
                Urls.Image("UsefulInformation/" + usefulInformation.UrlName + ".jpg"),
                usefulInformation.Name));
 }
Beispiel #29
0
 public static string Cdn(string file)
 {
     return(Common(Urls.JavaScript(file)));
 }
Beispiel #30
0
 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;"));
 }