コード例 #1
0
        private string GetCertView(TagImg certImg, decimal sigId, bool eng = false, bool vendor = false,
                                   bool ru = false)
        {
            var view = H.div[
                certImg.Style("margin:10px 0;"), H.br,
                Url.Graduate().DownloadCert(sigId, eng, vendor, ru, "Скачать").Class("ui-button"),
                ru&& !vendor ? H.div[H.h3["Поделитесь с друзьями!"],
                                     Htmls.AddThis(Html)] : null
                       ];

            return(view.ToString());
        }
コード例 #2
0
        public ActionResult Best2016(decimal id)
        {
            var exists = GroupCertService.CreateOrExistsBest2016(id);

            if (!exists)
            {
                return(NotFound());
            }

            var certImg = Images.Best2016(id);
            var view    = H.div[
                certImg.Style("margin:10px 0;"),
                H.br,
                Htmls.AddThis(Html)
                          ];

            return(BaseViewWithTitle(CommonTexts.Best2016,
                                     new PagePart(view.ToString())));
        }
コード例 #3
0
//		private string GetCertVendorView(TagImg certImg, decimal sigId) {
//			var view = H.div[
//				certImg.Style("margin:10px 0;"), H.br,
//				Url.Graduate().DownloadCertVendor(sigId, "Скачать").Class("ui-button")
//				];
//			return view.ToString();
//		}



/*
 *              public ActionResult SeminarCert(decimal sigId) {
 *                      if (sigId == 0)
 *                              return NotFound();
 *                      var fileSys = UserImages.GetWebinarCertFileSys(sigId);
 *                      if (!System.IO.File.Exists(fileSys)) {
 *                              var sig = GroupCertService.GetFullSig(sigId);
 *                              if (sig.Group.IsSem && sig.Group.IsFinished) {
 *                                      using (var image = Image.FromFile(UserImages.GetWebinarCertFileSys(0))) {
 *                                              ImageUtils.DrawWebinarCertText(image,
 *                                                      sig.Student.FullName, sig.Group.Title, sig.Group.DateBeg.Value).Save(fileSys);
 *                                      }
 *                              }
 *                              else {
 *                                      return NotFound();
 *                              }
 *                      }
 *
 *                      var view = GetCertView(Images.SeminarCert(sigId),sigId);
 *                      return BaseViewWithTitle("Сертификат", new PagePart(view));
 *
 *              }
 */

        public ActionResult GroupEnd(string courseTC)
        {
            courseTC = courseTC ?? "0";
            courseTC = courseTC.ToUpper();
            var fileSys = UserImages.GetGroupEndFileSys(courseTC);

            if (!System.IO.File.Exists(fileSys))
            {
                var name = CourseVM.WithCoursePrefix(CourseService.AllCourseLinks()[courseTC].Name);
                using (var image = Image.FromFile(UserImages.GetGroupEndFileSys("0"))) {
                    ImageUtils.DrawGroupEndText(image, name).Save(fileSys);
                }
            }

            var view = H.l(
                H.Img(Urls.SysToWeb(fileSys)).Style("margin-bottom:10px;"), H.br,
                Url.Graduate().DownloadGroupEnd(courseTC, "Скачать").Class("ui-button"),
                H.h3["Поделитесь с друзьями!"],
                Htmls.AddThis(Html)).ToString();

            return(BaseViewWithTitle("Я молодец!", new PagePart(view)));
        }