Inheritance: MonoBehaviour
示例#1
0
        private void frmTRACNGHIEM_Load(object sender, EventArgs e)
        {
            listBaiThi     = new List <BaiThi>();
            txtMaSV.Text   = frmThongTinThi.MaSV;
            txtLop.Text    = frmThongTinThi.Lop;
            txtTen.Text    = Software.mHoten;
            txtMonHoc.Text = frmThongTinThi.ChonMonHoc;
            txtLan.Text    = frmThongTinThi.LanThi.ToString();

            if (Software.mGroup == "GIAOVIEN")
            {
                lblLuuY.Text = frmThongTinThi.LuuY;
            }
            else
            {
                lblLuuY.Text = "QUY ĐỊNH CHUNG TRONG PHÒNG THI:\n\n"
                               + "  1. Không được gây ồn ào, thảo luận.\n"
                               + "  2. Không được tự ý sử dụng, di chuyển thiết bị\n"
                               + "  3. Thông báo cho cán bộ coi thi nếu gặp sự cố\n"
                               + "  4. Nếu bấm nút THOÁT, bài thi sẽ không được lưu lại và điểm bài thi là 0"
                               + "              Chúc các bạn thi tốt!";
            }
            int    soCau;
            string trinhDo;

            var dk    = db.GIAOVIEN_DANGKY.ToList();
            var query = dk.Select(p => new { p.THOIGIAN, p.TRINHDO, p.SOCAUTHI, p.MALOP, p.MAMH, p.LAN, p.NGAYTHI })
                        .Where(p => p.LAN == Convert.ToInt16(frmThongTinThi.LanThi)
                               & p.MALOP.Equals(frmThongTinThi.Lop)
                               & p.MAMH.Equals(frmThongTinThi.ChonMonHoc)).ToList();

            soCau       = Convert.ToInt16(query[0].SOCAUTHI);
            trinhDo     = Convert.ToString(query[0].TRINHDO);
            thoiGianThi = thoiGian = Convert.ToInt16(query[0].THOIGIAN);
            lanThi      = Convert.ToInt16(query[0].LAN);
            ngayThi     = Convert.ToDateTime(query[0].NGAYTHI);

            getInfo dethi = new getInfo();

            listDeThi = dethi.getBoDe(soCau, trinhDo, query[0].MAMH);
            hienThiCauHoi(0, 1);
            for (int i = 0; i < listDeThi.Count; i++)
            {
                int t = i + 1;
                dgvHoiTraLoi.Rows.Add(t + "", "");
            }

            labThoiGianThi.Text = thoiGianThi.ToString() + " (Phút)";
            thoiGian            = thoiGian - 1;
            labPhut.Text        = thoiGian.ToString();
            timeCountDown.Start();
        }
示例#2
0
        private void frmKetQuaThi_Load(object sender, EventArgs e)
        {
            CapNhatLuoiKetQua();
            if (Software.mGroup == "SINHVIEN")
            {
                getInfo      info = new getInfo();
                List <float> temp = info.tinhDiem();
                diem           = temp[0];
                soCauDUng      = (int)temp[1];
                txtDiem.Text   = diem + "";
                labketqua.Text = soCauDUng + "/" + socau;

                txtMaSV.Text  = Software.username;
                txtHoTen.Text = Software.mHoten;
                txtLop.Text   = Software.lop;

                for (int i = 0; i < socau; i++)
                {
                    dgvKetQua.Rows.Add(ketQua1[i].cauHoi, ketQua1[i].daChon, ketQua1[i].dapAn);
                }
                CapNhatBangDiem();
            }
            if (Software.mGroup == "GIAOVIEN")
            {
                getInfo      info = new getInfo();
                List <float> temp = info.tinhDiem();
                diem           = temp[0];
                soCauDUng      = (int)temp[1];
                txtDiem.Text   = diem + "";
                labketqua.Text = soCauDUng + "/" + socau;

                txtMaSV.Text  = Software.username;
                txtHoTen.Text = Software.mHoten;
                txtLop.Text   = Software.lop;

                for (int i = 0; i < socau; i++)
                {
                    dgvKetQua.Rows.Add(ketQua1[i].cauHoi, ketQua1[i].daChon, ketQua1[i].dapAn);
                }
            }
        }
示例#3
0
        public void Run()
        {
            GlobalConstants gc          = new GlobalConstants();
            DDebugg         debug       = new DDebugg();
            printAndExport  printExport = new printAndExport();

            Console.WriteLine("........................");
            Console.WriteLine("....THUMBS COLLECTOR....");
            Console.WriteLine("........................");
            Console.WriteLine();

            Console.Write("SEASON :");
            Console.WriteLine();

            getInfo getSeasonalInfo = new getInfo();
            string  inputSeason     = getSeasonalInfo.currentSeason();

            Validator validator = new Validator(inputSeason);

            inputSeason = validator.ValidateSeason();
            string validationPattern = validator.Pattern();

            //get allfiles and used geometries
            var allFilesPsd = getSeasonalInfo
                              .GetAllFilesParralelAsync(gc.psdExtension, gc.MenWomen, gc.YoungAthletes, gc.PlusSize); //psd search

            var allFilesJpg = getSeasonalInfo
                              .GetAllFilesParralelAsync(gc.jpgExtension, gc.MenWomen, gc.YoungAthletes, gc.PlusSize); //jpg search

            //main thumbs folder
            string thumbnailsFolder = gc.thumbnailsFolder;

            //enter directory where you want to save thumbs
            Console.WriteLine();
            Console.WriteLine("Please enter directory to save thumbs:".ToUpper());
            string destinationPath = getSeasonalInfo.DestinationTo();

            Console.WriteLine();
            Console.WriteLine($"DO YOU WANT TO COLLECT ALL \"{inputSeason}\" THUMBNAILS? (ALL / N)");
            var isAllThumbs = getSeasonalInfo.isApproved();

            var geometryInUse = getSeasonalInfo.GeometryInUse(allFilesPsd, validationPattern);

            string frontSide    = gc.frontSide;
            string backSide     = gc.backSide;
            string pngExtension = gc.pngExtension;

            string[] allowedExtensions = gc.allowedExtensions;
            int      thumbsCopied      = 0;
            int      thumbsNon         = 0;

            ////Scan thumbs folder
            List <string> collectedPaths = getSeasonalInfo.ScanThumbsFolder(thumbnailsFolder, allowedExtensions);
            StringBuilder badGeometries  = new StringBuilder();

            string inputGarment = "";

            if (isAllThumbs)
            {
                Console.WriteLine(TransferIfAll(inputGarment, frontSide, backSide, pngExtension, thumbnailsFolder,
                                                destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths, geometryInUse,
                                                inputSeason, gc, debug, printExport));
            }

            if (isAllThumbs == false)
            {
                Console.WriteLine(TransferIfAllFalse(inputGarment, frontSide, backSide, pngExtension, thumbnailsFolder,
                                                     destinationPath, thumbsCopied, thumbsNon, badGeometries, collectedPaths, geometryInUse,
                                                     inputSeason, gc, debug, printExport));
            }

            Console.WriteLine();
            Console.WriteLine($"DO YOU WANT TO GENERATE A LIST OF GEOEMETRIES/SKUS USED BY {inputSeason} ?: (Y / N)");
            var isGenerate = getSeasonalInfo.isApproved();

            if (isGenerate)
            {
                Stopwatch sw = new Stopwatch();
                sw.Start();
                Console.WriteLine($"GENERATING LIST...");

                while (true)
                {
                    if (allFilesJpg.IsCompleted == false)
                    {
                        continue;
                    }

                    break;
                }

                printExport.createOutputFileForEndOfSeasonAsync(validationPattern, allFilesJpg, inputSeason, gc.fileName, gc.xlsxExtension, gc.excelFilePath).Wait();

                Console.WriteLine("DONE!");
                sw.Stop();
                Console.WriteLine(sw.Elapsed);
            }
            else
            {
                Console.WriteLine("OK! Have a nice day!");
            }

            Console.ReadLine();
        }