Exemple #1
0
        private static VendorEngCertData GetVendorRuCertData(StudentInGroup sig, bool hd, int ruCertId)
        {
            var data = new VendorEngCertData(
                hd,
                ruCertId,
                sig.Student.FullName,
                sig.Group.Course.NameOfficial,
                sig.Group.DateEnd.GetValueOrDefault(),
                sig.Group.Teacher.GetOrDefault(x => x.FullName));

            return(data);
        }
Exemple #2
0
//		public static Image DrawGroupCertEngTextMs(Image image, bool hd, VendorEngCertData d) {
////			if (hd) {
////				return Draw(image, g => {
////					var x = 3500.0/727;
////					Func<int, int> f = z => (int) (z*x);
////					var dateText = "Computer Training Center at Bauman MSTU " + d.Date;
////					DrawString(g, d.FullName, f(281), f(210), 14, false, new Font("Arial", f(14)));
////					DrawString(g, d.CertName, f(281), f(310), 10, true, new Font("Arial", f(9)), f(280));
////					DrawString(g, d.TrainerName, f(460), f(428), 14, false, new Font("Verdana", f(7)));
////				});
////			} else {
////				return RenderVendorEngCertTexts(image, d);
////				//					DrawString(g, d.fullname, 281, 210,14,false, new Font("Arial", 14));
////				//					DrawString(g, d.certName, 281, 310,10,true,new Font("Arial", 9), 280);
////				//					DrawString(g, d.trainerName, 460, 428,14,false, new Font("Verdana", 7));
////				//					DrawString(g, "Computer Training Center at Bauman MSTU " + d.date, 440, 483,4,false,new Font("Verdana", 6));
////			}
//		}

        public static Image RenderVendorEngCertTexts(
            Image image,
            VendorEngCertData data)
        {
            var texts = data.GetTexts();

            return(Draw(image, g => {
                foreach (var text in texts)
                {
                    RenderText(g, text);
                }
            }));
        }
Exemple #3
0
        static void CreateCertEngMs()
        {
            var hd       = false;
            var certType = VendorEngCertData.graphisoft;

            using (var image = Image.FromFile(UserImages.GetGroupCertEngFileSys(certType, hd, true, false))) {
                var data = new VendorEngCertData(hd, certType,
                                                 "Svanov Svan", "Meijin: Сборка современного игрового компьютера",
                                                 DateTime.Today, "Svan Svanov");

                ImageUtils.RenderVendorEngCertTexts(image, data).Save("cert{0}-{1}.png".FormatWith(certType, hd ? "hd" : ""));
            }
        }
Exemple #4
0
        private static VendorEngCertData GetVendorCertData(StudentInGroup sig, bool hd, int vendorCerType, string fullName)
        {
            var employee = sig.Group.Teacher;
            var empName  = employee != null
                                ? employee.FirstNameEN + " " + employee.LastNameEN
                                : null;
            var data = new VendorEngCertData(
                hd,
                vendorCerType,
                fullName,
                sig.Group.Course.NameOfficialEn,
                sig.Group.DateEnd.GetValueOrDefault(),
                empName);


            return(data);
        }