コード例 #1
0
        public async Task <IActionResult> XemNhom(long id)
        {
            var DeTai = await _serviceDeTai.GetById(id);

            var NhomSV = await _serviceNhomSV.GetAll(x => x.IddeTai == DeTai.Id);

            return(ViewComponent("ToggleThongTinSinhVien", NhomSV.Select(x => x.IdsinhVienNavigation)));
        }
コード例 #2
0
ファイル: QLDeTaiController.cs プロジェクト: war-man/KLTN-1
        public async Task <IActionResult> LoadBaoCao(long id)
        {
            var DeTai = await _service.GetById(id);

            if (DeTai != null)
            {
                var baoCao = DeTai.BaoCaoTienDo.ToList();
                return(ViewComponent("ListBaoCao", baoCao));
            }
            return(ViewComponent("ListBaoCao"));
        }
コード例 #3
0
        public async Task <IActionResult> PhanCong(int idHoiDong, int idMoDot, long[] idsDeTai)
        {
            var hoiDong = await _serviceHoiDong.GetById(idHoiDong);

            var XDDG = hoiDong.XetDuyetVaDanhGia.Where(x => x.Status == 1).ToList();

            for (int i = 0; i < XDDG.Count(); i++)
            {
                XDDG[i].IddeTaiNavigation.TinhTrangDeTai = (int)StatusDeTai.DaDangKy;
                if (Dot == 2)
                {
                    XDDG[i].IddeTaiNavigation.TinhTrangDeTai = (int)StatusDeTai.DanhGiaLai;
                }
                XDDG[i].IddeTaiNavigation.TinhTrangPhanCong = (int)StatusPhanCong.ChuaPhanCong;
                await _serviceXetDuyetDanhGia.Delete(XDDG[i]);
            }
            if (idsDeTai.Length == 0)
            {
                hoiDong.StatusPhanCong = 0; //chưa phân công
                await _serviceHoiDong.Update(hoiDong);

                return(Ok(new
                {
                    status = true,
                    mess = MessageResult.UpdateSuccess
                }));
            }
            for (int i = 0; i < idsDeTai.Length; i++)
            {
                var deTai = await _serviceDeTai.GetById(idsDeTai[i]);

                deTai.TinhTrangPhanCong = (int)StatusPhanCong.DaPhanCong;
                XetDuyetVaDanhGia entity = new XetDuyetVaDanhGia
                {
                    IddeTai = idsDeTai[i],
                    IdmoDot = idMoDot,
                };
                hoiDong.XetDuyetVaDanhGia.Add(entity);
            }
            hoiDong.StatusPhanCong = 1; //đã phân công
            await _serviceHoiDong.Update(hoiDong);

            return(Ok(new
            {
                status = true,
                mess = MessageResult.UpdateSuccess
            }));
        }
コード例 #4
0
        public async Task <IActionResult> CreateEdit(BaoCaoTienDoViewModel vmodel)
        {
            var DeTai = await _service.GetById(vmodel.IddeTai);

            var now = DateTime.Now;

            if (!DeTai.NgayThucHien.HasValue || now < DeTai.NgayThucHien.Value)
            {
                return(Ok(new
                {
                    status = false,
                    toastr = MessageResult.ChuaDenTGThucHien
                }));
            }
            if (vmodel.Id == 0)
            {
                BaoCaoTienDo baoCao     = new BaoCaoTienDo();
                int          tuanDaNop  = 0;
                var          LastBaoCao = DeTai.BaoCaoTienDo.LastOrDefault();
                if (LastBaoCao != null)
                {
                    tuanDaNop = LastBaoCao.TuanDaNop;
                }
                baoCao.NoiDung = vmodel.NoiDung;
                baoCao.TienDo  = vmodel.TienDo;
                baoCao.NgayNop = DateTime.Now;
                if (CheckTuanNop(DeTai.NgayThucHien.Value, tuanDaNop, baoCao))
                {
                    if (await UpLoadFile(vmodel.File, baoCao))
                    {
                        DeTai.BaoCaoTienDo.Add(baoCao);
                        await _service.Update(DeTai);

                        return(Ok(new { status = true, mess = MessageResult.CreateSuccess }));
                    }
                    else
                    {
                        return(Ok(new { status = false, mess = MessageResult.UpLoadFileFail }));
                    }
                }
                else
                {
                    return(Ok(new
                    {
                        status = false,
                        toastr = MessageResult.DaNopBaoCao + tuanDaNop,
                    }));
                }
            }
            else
            {
                BaoCaoTienDo baoCao = await _serviceBaoCao.GetById(vmodel.Id);

                baoCao.NoiDung = vmodel.NoiDung;
                baoCao.TienDo  = vmodel.TienDo;
                baoCao.NgayNop = DateTime.Now;
                if (await UpLoadFile(vmodel.File, baoCao))
                {
                    await _serviceBaoCao.Update(baoCao);

                    return(Ok(new { status = true, mess = MessageResult.UpdateSuccess }));
                }
                else
                {
                    return(Ok(new { status = false, mess = MessageResult.UpLoadFileFail }));
                }
            }
        }
コード例 #5
0
        public async Task <IActionResult> LoadNoiDung(long idDeTai, int tab)
        {
            var deTai = await _serviceDeTai.GetById(idDeTai);

            ViewBag.TenDeTai = deTai.TenDeTai;
            ViewBag.NhomSV   = deTai.NhomSinhVien.Select(x => x.IdsinhVienNavigation);
            var xetDuyetVaDanhGia = deTai.XetDuyetVaDanhGia.SingleOrDefault(x => x.Status == 1);

            if (Dot == 2 && tab == 1)
            {
                xetDuyetVaDanhGia = deTai.XetDuyetVaDanhGia.SingleOrDefault(x => x.Status == 0);
            }
            ViewBag.XDDG = xetDuyetVaDanhGia;
            var    ct     = xetDuyetVaDanhGia.CtxetDuyetVaDanhGia;
            double diemtb = 0;
            int    chia   = 0;

            foreach (var item in ct)
            {
                if (item.Diem.HasValue)
                {
                    if (item.VaiTro == (int)LoaiVaiTro.PhanBien)
                    {
                        diemtb = diemtb + (2 * item.Diem.Value);
                        chia   = chia + 2;
                    }
                    else
                    {
                        diemtb = diemtb + item.Diem.Value;
                        chia++;
                    }
                }
            }
            if (chia == 0)
            {
                ViewBag.DiemTB = 0;
            }
            else
            {
                ViewBag.DiemTB = diemtb / chia * 1.0;
            }
            if (Dot == 1)
            {
                if (ViewBag.DiemTB < DotHienTai.DiemToiThieu)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.Huy;
                }
                else if (ViewBag.DiemTB > DotHienTai.DiemToiDa && DotHienTai.Loai == (int)MoDotLoai.XetDuyetDeTai)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.DaDangKy;
                }
                else if (ViewBag.DiemTB > DotHienTai.DiemToiDa && DotHienTai.Loai == (int)MoDotLoai.NghiemThuDeTai)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.HoanThanh;
                }
                else
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.DanhGiaLai;
                }
            }
            else
            {
                if (ViewBag.DiemTB < DotHienTai.DiemToiThieu)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.Huy;
                }
                else if (ViewBag.DiemTB > DotHienTai.DiemToiDa && DotHienTai.Loai == (int)MoDotLoai.XetDuyetDeTai)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.DaDangKy;
                }
                else if (ViewBag.DiemTB > DotHienTai.DiemToiDa && DotHienTai.Loai == (int)MoDotLoai.NghiemThuDeTai)
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.HoanThanh;
                }
                else
                {
                    deTai.TinhTrangDeTai = (int)StatusDeTai.Huy;
                }
            }
            await _serviceDeTai.Update(deTai);

            ViewBag.ctUSer = ct.SingleOrDefault(x => x.IdgiangVien == long.Parse(User.Identity.Name) && x.Status == 1);
            //foreach()
            ViewBag.Tab = tab;
            ViewBag.Dot = Dot;
            return(PartialView("_NoiDungXetDuyetGV", ct));
        }
コード例 #6
0
        public async Task <ActionResult> DeXuatDeTai(DeTaiNghienCuuViewModel vmodel)
        {
            var SV = await _serviceSV.GetById(long.Parse(User.Identity.Name));

            if (SV == null)
            {
                return(Ok(new
                {
                    status = false,
                    mess = MessageResult.NotFoundSV
                }));
            }
            if (vmodel.IdgiangVien == 0)
            {
                vmodel.IdgiangVien = null;
            }
            //Update DeTai
            if (vmodel.Id > 0)
            {
                var DeTai = await _service.GetById(vmodel.Id);

                DeTai.IdgiangVien = vmodel.IdgiangVien;
                DeTai.MoTa        = vmodel.MoTa;
                DeTai.TenDeTai    = vmodel.TenDeTai;
                if (await UpLoadFile(vmodel.Files, DeTai) == false)
                {
                    return(Json(new { status = false, mess = MessageResult.UpLoadFileFail }));
                }
                await _service.Update(DeTai);

                return(Ok(new { status = true, mess = MessageResult.UpdateSuccess }));
            }
            //Kiểm tra SV đã có đề tài?
            var nhomSV = SV.NhomSinhVien.SingleOrDefault(x => x.IdnhomNavigation.Status == (int)BaseStatus.Active);

            if (nhomSV != null)
            {
                return(Ok(new
                {
                    status = false,
                    mess = MessageResult.ExistDeTai
                }));
            }
            IEnumerable <DeTaiNghienCuu> list = await _service.GetAll();

            if (list.Count() != 0)
            {
                DeTaiNghienCuu LastE = list.OrderBy(x => x.Id).LastOrDefault();
                vmodel.Id = _service.KhoiTaoMa(LastE);
            }
            else
            {
                vmodel.Id = long.Parse(DateTime.Now.Year.ToString() + "001");
            }

            var model = new DeTaiNghienCuu()
            {
                Id              = vmodel.Id,
                TenDeTai        = vmodel.TenDeTai,
                MoTa            = vmodel.MoTa,
                NgayDangKy      = DateTime.Now,
                IdNguoiDangKy   = long.Parse(User.Identity.Name),
                IdgiangVien     = vmodel.IdgiangVien,
                NgayLap         = DateTime.Now,
                TinhTrangDangKy = (int)StatusDangKyDeTai.Het,
                TinhTrangDeTai  = (int)StatusDeTai.DaDangKy,
                Loai            = LoaiDeTai.DeXuat
            };

            if (await UpLoadFile(vmodel.Files, model) == false)
            {
                return(Json(new { status = false, mess = MessageResult.UpLoadFileFail }));
            }
            try
            {
                Nhom nhom = new Nhom();
                await _serviceNhom.Add(nhom);

                NhomSinhVien nhomSinhVien = new NhomSinhVien {
                    Idnhom = nhom.Id, IdsinhVien = SV.Mssv
                };
                model.NhomSinhVien.Add(nhomSinhVien);
                await _service.Add(model);

                return(Json(new { status = true, create = true, data = model, mess = MessageResult.CreateSuccess }));
            }
            catch
            {
                return(Json(new { status = false, mess = MessageResult.Fail }));
            }
        }
コード例 #7
0
        public async Task <IActionResult> XuatBaoCaoChiTietDeTai(long id)
        {
            #region -- Lấy dữ liệu --
            DeTaiNghienCuu deTaiNghienCuu = await _service.GetById(id);

            //Dữ liệu nhóm
            var NhomSV = await _serviceNhomSV.GetAll(x => x.IddeTai == id);

            IEnumerable <Data.Models.SinhVien> sinhViens = NhomSV.Select(x => x.IdsinhVienNavigation);

            //Dữ liệu hội đồng xét duyệt
            IEnumerable <XetDuyetVaDanhGia> hoidongXetDuyet = await _serviceXetDuyet.GetAll(x => x.IddeTai == id && x.IdmoDotNavigation.Loai == (int)MoDotLoai.XetDuyetDeTai);


            //Dữ liệu hội đồng đánh giá nghiệm thu
            IEnumerable <XetDuyetVaDanhGia> hoidongNghiemThu = await _serviceXetDuyet.GetAll(x => x.IddeTai == id && x.IdmoDotNavigation.Loai == (int)MoDotLoai.NghiemThuDeTai);

            #endregion

            var stream = new MemoryStream();

            using (var package = new ExcelPackage(stream))
            {
                var Sheet1 = package.Workbook.Worksheets.Add("Báo cáo chi tiết đề tài");



                Sheet1.Cells["A1"].Style.Font.Bold           = true;
                Sheet1.Cells["A1"].Value                     = "TRƯỜNG ĐẠI HỌC SÀI GÒN";
                Sheet1.Cells["F1"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Right;
                Sheet1.Cells["F1"].Value                     = DateTime.Now.ToString("HH:mm, dd/MM/yyyy");
                Sheet1.Cells["A3:F3"].Merge                  = true;
                Sheet1.Cells["A3"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                Sheet1.Cells["A3"].Style.Font.Bold           = true;
                Sheet1.Cells["A3"].Value                     = "BÁO CÁO CHI TIẾT ĐỀ TÀI " + deTaiNghienCuu.TenDeTai.ToUpper();

                if (sinhViens.Any())
                {
                    #region -- Header Thông tin sinh viên --
                    Sheet1.Cells["A5"].Style.Font.Bold = true;
                    Sheet1.Cells["A5"].Value           = "Thông tin sinh viên";

                    Sheet1.Cells["A7:E7"].Style.Font.Bold           = true;
                    Sheet1.Cells["A7:E7"].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                    Sheet1.Cells["A7"].Value = "MSSV";
                    Sheet1.Cells["B7"].Value = "Họ tên";
                    Sheet1.Cells["C7"].Value = "SĐT";
                    Sheet1.Cells["D7"].Value = "Email";

                    #endregion

                    #region -- Details Thông tin sinh viên --
                    int rowSheet1 = 8;
                    foreach (var item in sinhViens)
                    {
                        Sheet1.Cells[string.Format("A{0}", rowSheet1)].Value = item.Mssv;
                        Sheet1.Cells[string.Format("B{0}", rowSheet1)].Value = item.Ho + " " + item.Ten;
                        Sheet1.Cells[string.Format("C{0}", rowSheet1)].Value = item.Sdt;
                        Sheet1.Cells[string.Format("D{0}", rowSheet1)].Value = item.Email;
                        rowSheet1++;
                    }

                    Sheet1.Cells["A7" + ":" + string.Format("D{0}", rowSheet1 - 1)].Style.Border.Top.Style    = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    Sheet1.Cells["A7" + ":" + string.Format("D{0}", rowSheet1 - 1)].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    Sheet1.Cells["A7" + ":" + string.Format("D{0}", rowSheet1 - 1)].Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    Sheet1.Cells["A7" + ":" + string.Format("D{0}", rowSheet1 - 1)].Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                    #endregion


                    //Phần xét duyệt đề tài

                    int rowSheet2 = rowSheet1 + 1;
                    Sheet1.Cells["A" + (rowSheet2)].Style.Font.Bold = true;
                    Sheet1.Cells["A" + (rowSheet2)].Value           = "XÉT DUYỆT ĐỀ TÀI";

                    if (hoidongXetDuyet.Any())
                    {
                        foreach (var dot in hoidongXetDuyet)
                        {
                            #region -- Header Hội đồng xét duyệt --
                            rowSheet2 += 2;
                            Sheet1.Cells["A" + (rowSheet2)].Value = "Hội đồng: ";
                            Sheet1.Cells["B" + (rowSheet2)].Value = dot.IdhoiDongNavigation.TenHoiDong;

                            rowSheet2 += 1;
                            int rowStart = rowSheet2;
                            int rowEnd   = rowSheet2;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowSheet2, rowSheet2)].Style.Font.Bold           = true;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowSheet2, rowSheet2)].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                            Sheet1.Cells["A" + (rowSheet2)].Value = "Thành viên";
                            Sheet1.Cells["B" + (rowSheet2)].Value = "Vai trò";
                            Sheet1.Cells["C" + (rowSheet2)].Value = "Câu hỏi";
                            Sheet1.Cells["D" + (rowSheet2)].Value = "Câu trả lời";
                            Sheet1.Cells["E" + (rowSheet2)].Value = "Nhận xét";
                            Sheet1.Cells["F" + (rowSheet2)].Value = "Điểm";
                            #endregion

                            #region -- Details Hội đồng xét duyệt --
                            rowSheet2 += 1;
                            IEnumerable <CtxetDuyetVaDanhGia> ctXetDuyet = await _serviceCTXetDuyetVaDanhGia.GetAll(x => x.IdxetDuyetNavigation.IddeTai == id &&
                                                                                                                    x.IdxetDuyetNavigation.IdmoDotNavigation.Loai == (int)MoDotLoai.XetDuyetDeTai &&
                                                                                                                    x.IdxetDuyet == dot.Id);

                            foreach (var item in ctXetDuyet)
                            {
                                Sheet1.Cells[string.Format("A{0}", rowSheet2)].Value = item.IdgiangVienNavigation.Ho + " " + item.IdgiangVienNavigation.Ten;
                                if (item.VaiTro == 1)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet2)].Value = "Chủ tịch";
                                }
                                else if (item.VaiTro == 2)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet2)].Value = "Ủy viên";
                                }
                                else if (item.VaiTro == 3)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet2)].Value = "Thư ký";
                                }
                                else
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet2)].Value = "Phản biện";
                                }
                                Sheet1.Cells[string.Format("C{0}", rowSheet2)].Value = item.CauHoi;
                                Sheet1.Cells[string.Format("D{0}", rowSheet2)].Value = item.CauTraLoi;
                                Sheet1.Cells[string.Format("E{0}", rowSheet2)].Value = item.NhanXet;
                                Sheet1.Cells[string.Format("F{0}", rowSheet2)].Value = item.Diem;
                                rowSheet2++;
                            }
                            Sheet1.Cells[string.Format("A{0}:E{1}", rowSheet2, rowSheet2)].Merge = true;
                            Sheet1.Cells["A" + rowSheet2].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                            Sheet1.Cells["A" + rowSheet2].Style.Font.Bold           = true;
                            Sheet1.Cells["A" + rowSheet2].Value = "Điểm trung bình";
                            Sheet1.Cells["F" + rowSheet2].Value = TinhDiemTrungBinh(dot.Id).Result;

                            rowEnd = rowSheet2;

                            rowSheet2 += 1;
                            Sheet1.Cells["A" + rowSheet2].Value = "KẾT QUẢ:";
                            if (TinhDiemTrungBinh(dot.Id).Result > dot.IdmoDotNavigation.DiemToiDa)
                            {
                                Sheet1.Cells["B" + rowSheet2].Value = "ĐẠT";
                            }
                            else if (TinhDiemTrungBinh(dot.Id).Result < dot.IdmoDotNavigation.DiemToiThieu)
                            {
                                Sheet1.Cells["B" + rowSheet2].Value = "KHÔNG ĐẠT";
                            }
                            else
                            {
                                Sheet1.Cells["B" + rowSheet2].Value = "DUYỆT LẠI";
                            }

                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Top.Style    = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            #endregion
                        }
                    }
                    else
                    {
                        Sheet1.Cells["A" + (rowSheet2)].Style.Font.Bold = true;
                        Sheet1.Cells["A" + (rowSheet2)].Value           = "ĐỀ TÀI CHƯA ĐƯỢC XÉT DUYỆT";
                    }


                    //Phần đánh giá nghiệm thu đề tài
                    int rowSheet3 = rowSheet2 + 2;
                    Sheet1.Cells["A" + (rowSheet3)].Style.Font.Bold = true;
                    Sheet1.Cells["A" + (rowSheet3)].Value           = "ĐÁNH GIÁ NGHIỆM THU ĐỀ TÀI";

                    if (hoidongNghiemThu.Any())
                    {
                        foreach (var dot in hoidongNghiemThu)
                        {
                            #region -- Header Hội đồng nghiệm thu --
                            rowSheet3 += 2;
                            Sheet1.Cells["A" + (rowSheet3)].Value = "Hội đồng: ";
                            Sheet1.Cells["B" + (rowSheet3)].Value = dot.IdhoiDongNavigation.TenHoiDong;

                            rowSheet3 += 1;
                            int rowStart = rowSheet3;
                            int rowEnd   = rowSheet3;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowSheet3, rowSheet3)].Style.Font.Bold           = true;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowSheet3, rowSheet3)].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                            Sheet1.Cells["A" + (rowSheet3)].Value = "Thành viên";
                            Sheet1.Cells["B" + (rowSheet3)].Value = "Vai trò";
                            Sheet1.Cells["C" + (rowSheet3)].Value = "Câu hỏi";
                            Sheet1.Cells["D" + (rowSheet3)].Value = "Câu trả lời";
                            Sheet1.Cells["E" + (rowSheet3)].Value = "Nhận xét";
                            Sheet1.Cells["F" + (rowSheet3)].Value = "Điểm";
                            #endregion

                            #region -- Details Hội đồng nghiệm thu --
                            rowSheet3 += 1;
                            IEnumerable <CtxetDuyetVaDanhGia> ctXetDuyet = await _serviceCTXetDuyetVaDanhGia.GetAll(x => x.IdxetDuyetNavigation.IddeTai == id &&
                                                                                                                    x.IdxetDuyetNavigation.IdmoDotNavigation.Loai == (int)MoDotLoai.NghiemThuDeTai &&
                                                                                                                    x.IdxetDuyet == dot.Id);

                            foreach (var item in ctXetDuyet)
                            {
                                Sheet1.Cells[string.Format("A{0}", rowSheet3)].Value = item.IdgiangVienNavigation.Ho + " " + item.IdgiangVienNavigation.Ten;
                                if (item.VaiTro == 1)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet3)].Value = "Chủ tịch";
                                }
                                else if (item.VaiTro == 2)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet3)].Value = "Ủy viên";
                                }
                                else if (item.VaiTro == 3)
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet3)].Value = "Thư ký";
                                }
                                else
                                {
                                    Sheet1.Cells[string.Format("B{0}", rowSheet3)].Value = "Phản biện";
                                }
                                Sheet1.Cells[string.Format("C{0}", rowSheet3)].Value = item.CauHoi;
                                Sheet1.Cells[string.Format("D{0}", rowSheet3)].Value = item.CauTraLoi;
                                Sheet1.Cells[string.Format("E{0}", rowSheet3)].Value = item.NhanXet;
                                Sheet1.Cells[string.Format("F{0}", rowSheet3)].Value = item.Diem;
                                rowSheet3++;
                            }
                            Sheet1.Cells[string.Format("A{0}:E{1}", rowSheet3, rowSheet3)].Merge = true;
                            Sheet1.Cells["A" + rowSheet3].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
                            Sheet1.Cells["A" + rowSheet3].Style.Font.Bold           = true;
                            Sheet1.Cells["A" + rowSheet3].Value = "Điểm trung bình";
                            Sheet1.Cells["F" + rowSheet3].Value = TinhDiemTrungBinh(dot.Id).Result;

                            rowEnd = rowSheet3;

                            rowSheet3 += 1;
                            Sheet1.Cells["A" + rowSheet3].Value = "KẾT QUẢ:";
                            if (TinhDiemTrungBinh(dot.Id).Result > dot.IdmoDotNavigation.DiemToiDa)
                            {
                                Sheet1.Cells["B" + rowSheet3].Value = "ĐẠT";
                            }
                            else if (TinhDiemTrungBinh(dot.Id).Result < dot.IdmoDotNavigation.DiemToiThieu)
                            {
                                Sheet1.Cells["B" + rowSheet3].Value = "KHÔNG ĐẠT";
                            }
                            else
                            {
                                Sheet1.Cells["B" + rowSheet3].Value = "DUYỆT LẠI";
                            }

                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Top.Style    = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Left.Style   = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            Sheet1.Cells[string.Format("A{0}:F{1}", rowStart, rowEnd)].Style.Border.Right.Style  = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
                            #endregion
                        }
                    }
                    else
                    {
                        Sheet1.Cells["A" + (rowSheet3)].Style.Font.Bold = true;
                        Sheet1.Cells["A" + (rowSheet3)].Value           = "ĐỀ TÀI CHƯA ĐƯỢC ĐÁNH GIÁ NGHIỆM THU";
                    }
                }
                else
                {
                    Sheet1.Cells["A5"].Style.Font.Bold = true;
                    Sheet1.Cells["A5"].Value           = "ĐỀ TÀI CHƯA ĐƯỢC THỰC HIỆN";
                }

                #region -- Footer --
                Sheet1.Cells["A:AZ"].AutoFitColumns();
                #endregion

                package.Save();
            }

            stream.Position = 0;
            var filename = $"BaoCaoChiTietDeTai.xlsx";
            return(File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", filename));
        }