示例#1
0
        public ActionResult DuyetHoSoNgoaiTinh(int mahoso)
        {
            int     permisstionId = 3;
            Account account       = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(RedirectToRoute("login"));
            }
            List <UserPermission> userPermission = (List <UserPermission>)Session[Utils.Constants.USER_PERMISSION_SESSION];

            if (userPermission.Where(s => s.PermissionId == permisstionId).SingleOrDefault() == null)
            {
                return(RedirectToRoute("login"));
            }
            using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
            {
                ViewBag.ThuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(mahoso);
                ViewBag.MaHoSo       = mahoso;
                if (ViewBag.ThuyenChuyen == null)
                {
                    return(RedirectToRoute("thuyenchuyentiepnhanhoso"));
                }
                return(View());
            }
        }
示例#2
0
        public ActionResult TrangThaiHoSoNgoaiTinh(int id, int year)
        {
            int     permisstionId = 4;
            Account account       = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(RedirectToRoute("login"));
            }
            List <UserPermission> userPermission = (List <UserPermission>)Session[Utils.Constants.USER_PERMISSION_SESSION];

            if (userPermission.Where(s => s.PermissionId == permisstionId).SingleOrDefault() == null)
            {
                return(RedirectToRoute("login"));
            }

            else
            {
                using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
                {
                    ViewBag.ThuyenChuyens = _thuyenChuyenService.GetThuyenChuyenByStatusAndDvqlAndYear(id, account.DvqlId, year);
                }
            }
            using (var _statusThuyenChuyen = new TrangThaiHoSoService())
            {
                ViewBag.StatusThuyenChuyen = _statusThuyenChuyen.GetStatusThuyenChuyens();
            }
            ViewBag.StatusId = id;
            ViewBag.Year     = year;
            return(View());
        }
示例#3
0
        public ActionResult NhanHoSoThuyenChuyenNgoaiTinh(int mahoso)
        {
            int     permisstionId = 3;
            Account account       = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(Json(new ReturnResult(403, "access denied", null), JsonRequestBehavior.AllowGet));
            }
            List <UserPermission> userPermission = (List <UserPermission>)Session[Utils.Constants.USER_PERMISSION_SESSION];

            if (userPermission.Where(s => s.PermissionId == permisstionId).SingleOrDefault() == null)
            {
                return(Json(new ReturnResult(403, "access denied", null), JsonRequestBehavior.AllowGet));
            }
            using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
            {
                ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(mahoso);
                if (thuyenChuyen == null)
                {
                    return(Json(new ReturnResult(400, "Không tìm thấy hồ sơ", null), JsonRequestBehavior.AllowGet));
                }
                if (thuyenChuyen.StatusId != null)
                {
                    return(Json(new ReturnResult(400, "Hồ sơ đã được tiếp nhận trước đó", null), JsonRequestBehavior.AllowGet));
                }
                _thuyenChuyenService.TiepNhanHoSo(thuyenChuyen, 1, account.Id);
                return(Json(new ReturnResult(200, "success", null), JsonRequestBehavior.AllowGet));
            }
        }
示例#4
0
 public ActionResult ChiTietHoSoNgoaiTinh(int mahoso)
 {
     using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
     {
         ViewBag.ThuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(mahoso);
         return(View());
     }
 }
示例#5
0
        public ActionResult DanhSachHoSoDaTiepNhan(int year)
        {
            int     permisstionId = 5;
            Account account       = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(RedirectToRoute("login"));
            }
            List <UserPermission> userPermission = (List <UserPermission>)Session[Utils.Constants.USER_PERMISSION_SESSION];

            if (userPermission.Where(s => s.PermissionId == permisstionId).SingleOrDefault() == null)
            {
                return(RedirectToRoute("login"));
            }
            else
            {
                using (var _thuyenChuyenNgoaiTinhService = new ThuyenChuyenNgoaiTinhService())
                {
                    List <ThuyenChuyenNgoaiTinh> thuyenChuyenNgoaiTinhs = _thuyenChuyenNgoaiTinhService.GetThuyenChuyensByYearDaTiepNhan(year);
                    using (var _thuyenChuyenService = new ThuyenChuyenRepository())
                    {
                        List <ThuyenChuyen> thuyenChuyens = _thuyenChuyenService.GetThuyenChuyensByYearDaTiepNhan(year);
                        List <ThuyenChuyenContainNgoaiTinhDTO> thuyenChuyenContainNgoais = new List <ThuyenChuyenContainNgoaiTinhDTO>();
                        foreach (var item in thuyenChuyenNgoaiTinhs)
                        {
                            ThuyenChuyenContainNgoaiTinhDTO thuyenChuyenContainNgoaiTinhDTO = new ThuyenChuyenContainNgoaiTinhDTO();
                            thuyenChuyenContainNgoaiTinhDTO.CMND         = item.CMND;
                            thuyenChuyenContainNgoaiTinhDTO.HoTen        = item.HoTen;
                            thuyenChuyenContainNgoaiTinhDTO.Id           = item.Id;
                            thuyenChuyenContainNgoaiTinhDTO.NamSinh      = item.NamSinh.Value;
                            thuyenChuyenContainNgoaiTinhDTO.NgayTiepNhan = item.NgayTiepNhan.Value;
                            thuyenChuyenContainNgoaiTinhDTO.TienTo       = item.TienTo;
                            thuyenChuyenContainNgoaiTinhDTO.DangCongTac  = item.DVDCTTenTruong + " (" + item.Province.Type + " " + item.Province.Name + ")";
                            thuyenChuyenContainNgoaiTinhDTO.XinChuyenDen = item.School.TenTruong;
                            thuyenChuyenContainNgoais.Add(thuyenChuyenContainNgoaiTinhDTO);
                        }
                        foreach (var item in thuyenChuyens)
                        {
                            ThuyenChuyenContainNgoaiTinhDTO thuyenChuyenContainNgoaiTinhDTO = new ThuyenChuyenContainNgoaiTinhDTO();
                            thuyenChuyenContainNgoaiTinhDTO.CMND         = item.CMND;
                            thuyenChuyenContainNgoaiTinhDTO.HoTen        = item.HoTen;
                            thuyenChuyenContainNgoaiTinhDTO.Id           = item.Id;
                            thuyenChuyenContainNgoaiTinhDTO.NamSinh      = item.NamSinh.Value;
                            thuyenChuyenContainNgoaiTinhDTO.NgayTiepNhan = item.NgayTiepNhan.Value;
                            thuyenChuyenContainNgoaiTinhDTO.TienTo       = item.TienTo;
                            thuyenChuyenContainNgoaiTinhDTO.DangCongTac  = item.School.TenTruong;
                            thuyenChuyenContainNgoaiTinhDTO.XinChuyenDen = item.School1.TenTruong;
                            thuyenChuyenContainNgoais.Add(thuyenChuyenContainNgoaiTinhDTO);
                        }
                        ViewBag.ThuyenChuyens = thuyenChuyenContainNgoais.OrderByDescending(s => s.NgayTiepNhan);
                    }
                }
            }
            ViewBag.Year = year;
            return(View());
        }
 public ActionResult DangKiThanhCong(int id)
 {
     using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
     {
         ViewBag.ThuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(id);
         ViewBag.Id           = id;
         return(View());
     }
 }
示例#7
0
 public ActionResult CapNhatTrangThaiNgoaiTinh(int maHoSo, int trangThaiId, DateTime date)
 {
     using (var _thuyenChuyen = new ThuyenChuyenNgoaiTinhService())
     {
         ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyen.GetThuyenChuyensById(maHoSo);
         if (thuyenChuyen == null)
         {
             return(Json(new ReturnResult(400, "failed", null), JsonRequestBehavior.AllowGet));
         }
         _thuyenChuyen.CapNhatTrangThaiHoSo(thuyenChuyen, trangThaiId);
         return(Json(new ReturnResult(200, "success", null), JsonRequestBehavior.AllowGet));
     }
 }
 public ActionResult KiemTraMaHopLe(string madangki, string cmnd)
 {
     if (madangki.ToUpper().Contains("TCN"))
     {
         using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
         {
             ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyenService.CheckThuyenChuyenExistedByIdAndCMND(madangki, cmnd);
             if (thuyenChuyen == null)
             {
                 return(Json(new ReturnResult(400, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
             }
             else if (thuyenChuyen.StatusId != null && thuyenChuyen.StatusId != 5)
             {
                 return(Json(new ReturnResult(400, "Hồ sơ đã được tiếp nhân. Do đó không được cập nhật", null), JsonRequestBehavior.AllowGet));
             }
             var thuyenChuyenJson = JsonConvert.SerializeObject(thuyenChuyen,
                                                                Formatting.None,
                                                                new JsonSerializerSettings()
             {
                 ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
             });
             return(Json(new ReturnResult(200, "success", thuyenChuyenJson), JsonRequestBehavior.AllowGet));
         }
     }
     else if (madangki.ToUpper().Contains("TC"))
     {
         using (var _thuyenChuyenService = new ThuyenChuyenRepository())
         {
             ThuyenChuyen thuyenChuyen = _thuyenChuyenService.CheckThuyenChuyenExistedByIdAndCMND(madangki, cmnd);
             if (thuyenChuyen == null)
             {
                 return(Json(new ReturnResult(400, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
             }
             else if (thuyenChuyen.StatusId != null && thuyenChuyen.StatusId != 5)
             {
                 return(Json(new ReturnResult(400, "Hồ sơ đã được tiếp nhân. Do đó không được cập nhật", null), JsonRequestBehavior.AllowGet));
             }
             var thuyenChuyenJson = JsonConvert.SerializeObject(thuyenChuyen,
                                                                Formatting.None,
                                                                new JsonSerializerSettings()
             {
                 ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
             });
             return(Json(new ReturnResult(200, "success", thuyenChuyenJson), JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         return(Json(new ReturnResult(400, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
     }
 }
 public ActionResult DangKiMoiPost(ThuyenChuyenNgoaiTinhDTO thuyenChuyenDTO)
 {
     if (ModelState.IsValid)
     {
         ThuyenChuyenNgoaiTinh thuyenChuyen = new ThuyenChuyenNgoaiTinh();
         Mapper.Map(thuyenChuyenDTO, thuyenChuyen);
         using (var _thuyenChuyenNgoaiTinhService = new ThuyenChuyenNgoaiTinhService())
         {
             ThuyenChuyenNgoaiTinh thuyenChuyenCreated = _thuyenChuyenNgoaiTinhService.CreateThuyenChuyen(thuyenChuyen);
             return(Json(new ReturnResult(200, "success", thuyenChuyen.Id), JsonRequestBehavior.AllowGet));
         }
     }
     return(Json(new ReturnResult(400, "failed", null), JsonRequestBehavior.AllowGet));
 }
 public ActionResult KiemTraMaHopLe(string madangki, string cmnd)
 {
     using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
     {
         ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyenService.CheckThuyenChuyenExistedByIdAndCMND(madangki.Trim(), cmnd.Trim());
         if (thuyenChuyen == null)
         {
             return(Json(new ReturnResult(400, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
         }
         else if (thuyenChuyen.StatusId != null && thuyenChuyen.StatusId != 5)
         {
             return(Json(new ReturnResult(400, "Hồ sơ đã được tiếp nhân. Do đó không được cập nhật", null), JsonRequestBehavior.AllowGet));
         }
         return(Json(new ReturnResult(200, "success", null), JsonRequestBehavior.AllowGet));
     }
 }
        public ActionResult CapNhatPost(ThuyenChuyenNgoaiTinhDTO thuyenChuyenDTO, int id)
        {
            if (ModelState.IsValid)
            {
                using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
                {
                    ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(id);
                    Mapper.Map(thuyenChuyenDTO, thuyenChuyen);
                    thuyenChuyen.UpdateAt = DateTime.Now;
                    ThuyenChuyenNgoaiTinh thuyenChuyenUpdated = _thuyenChuyenService.CapNhatThuyenChuyen(thuyenChuyen);
                    if (thuyenChuyenUpdated == null)
                    {
                        return(Json(new ReturnResult(400, "failed", null), JsonRequestBehavior.AllowGet));
                    }
                    return(Json(new ReturnResult(200, "success", thuyenChuyenUpdated.Id), JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(new ReturnResult(400, "failed", null), JsonRequestBehavior.AllowGet));
        }
示例#12
0
        public async Task <ActionResult> DownloadThuyenChuyenNgoaiTinh(int statusId, int year)
        {
            Account account = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(RedirectToRoute("login"));
            }
            using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
            {
                List <ThuyenChuyenNgoaiTinh> thuyenChuyens = _thuyenChuyenService.GetThuyenChuyenByStatusAndDvqlAndYear(statusId, account.DvqlId, year);
                string filePath = System.Web.HttpContext.Current.Server.MapPath("~/Utils/ds-thuyenchuyenngoaitinh.xlsx");
                using (var _statusThuyenChuyen = new TrangThaiHoSoService())
                {
                    StatusThuyenChuyen statusThuyenChuyen = _statusThuyenChuyen.GetStatusThuyenChuyensById(statusId);
                    await Utils.ExportExcel.GenerateXLSThuyenChuyenNgoaiTinh(thuyenChuyens, filePath, statusThuyenChuyen.Name);

                    return(File(filePath, "application/vnd.ms-excel", "ds-thuyenchuyenngoaitinh.xlsx"));
                }
            }
        }
示例#13
0
        public ActionResult KiemTraMaHoSo(string mahoso)
        {
            int     permisstionId = 3;
            Account account       = (Account)Session[Utils.Constants.USER_SESSION];

            if (account == null)
            {
                return(Json(new ReturnResult(403, "access denied", null), JsonRequestBehavior.AllowGet));
            }
            List <UserPermission> userPermission = (List <UserPermission>)Session[Utils.Constants.USER_PERMISSION_SESSION];

            if (userPermission.Where(s => s.PermissionId == permisstionId).SingleOrDefault() == null)
            {
                return(Json(new ReturnResult(403, "access denied", null), JsonRequestBehavior.AllowGet));
            }
            if (mahoso.ToUpper().Contains("TCN"))
            {
                using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
                {
                    ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenChuyenService.GetThuyenChuyensByMaHoSo(mahoso.Trim());
                    if (thuyenChuyen == null)
                    {
                        return(Json(new ReturnResult(404, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
                    }
                    else if (thuyenChuyen.School.DVQLId != account.DvqlId)
                    {
                        return(Json(new ReturnResult(400, "Hồ sơ thuộc về " + thuyenChuyen.School.DVQL.TenDayDu, null), JsonRequestBehavior.AllowGet));
                    }
                    var thuyenChuyenJson = JsonConvert.SerializeObject(thuyenChuyen,
                                                                       Formatting.None,
                                                                       new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
                    });
                    return(Json(new ReturnResult(200, "success", thuyenChuyenJson), JsonRequestBehavior.AllowGet));
                }
            }
            else if (mahoso.ToUpper().Contains("TC"))
            {
                using (var _thuyenChuyenService = new ThuyenChuyenRepository())
                {
                    ThuyenChuyen thuyenChuyen = _thuyenChuyenService.GetThuyenChuyensByMaHoSo(mahoso.Trim());
                    if (thuyenChuyen == null)
                    {
                        return(Json(new ReturnResult(404, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
                    }
                    else if (thuyenChuyen.School.DVQLId != account.DvqlId)
                    {
                        return(Json(new ReturnResult(400, "Hồ sơ thuộc về " + thuyenChuyen.School.DVQL.TenDayDu, null), JsonRequestBehavior.AllowGet));
                    }

                    var thuyenChuyenJson = JsonConvert.SerializeObject(thuyenChuyen,
                                                                       Formatting.None,
                                                                       new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
                    });
                    return(Json(new ReturnResult(200, "success", thuyenChuyenJson), JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new ReturnResult(404, "Không tìm thấy", null), JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult CapNhatThuyenChuyen(string id, string cmnd)
        {
            using (var _thuyenchuyenService = new ThuyenChuyenNgoaiTinhService())
            {
                ThuyenChuyenNgoaiTinh thuyenChuyen = _thuyenchuyenService.CheckThuyenChuyenExistedByIdAndCMND(id.Trim(), cmnd.Trim());
                if (thuyenChuyen == null || (thuyenChuyen.StatusId != 5 && thuyenChuyen.StatusId != null))
                {
                    return(RedirectToRoute("thuyenchuyenkiemtramatruong"));
                }

                using (var _districtService = new DistrictRepository())
                {
                    ViewBag.DistrictsNoiSinh = _districtService.GetDistrictByProvinceId(thuyenChuyen.Ward.District.ProvinceId);
                    ViewBag.DistrictsHKTT    = _districtService.GetDistrictByProvinceId(thuyenChuyen.Ward.District.ProvinceId);
                    ViewBag.Districts        = _districtService.GetDistrictByProvinceId(79);
                }
                using (var _wardService = new WardRepository())
                {
                    ViewBag.WardsNoiSinh = _wardService.GetWardByDistrictId(thuyenChuyen.Ward.DistrictID);
                    ViewBag.WardsHKTT    = _wardService.GetWardByDistrictId(thuyenChuyen.Ward.DistrictID);
                }
                using (var _provinceService = new ProvinceRepository())
                {
                    ViewBag.Provinces = _provinceService.GetProvinceByCountryId(237);
                }
                using (var _CapTruongService = new CapTruongRepository())
                {
                    ViewBag.CapTruongs = _CapTruongService.GetCapTruongs();
                }
                using (var _monDuTuyen = new MonDuTuyenRepository())
                {
                    ViewBag.MonDays = _monDuTuyen.GetMonDuTuyens();
                }
                using (var _hinhThucDaoTao = new HinhThucDaoTaoRepository())
                {
                    ViewBag.HinhThucDaoTaos = _hinhThucDaoTao.GetHinhThucDaoTaos();
                }
                using (var _xepLoaiHocLuc = new XepLoaiHocLucRepository())
                {
                    ViewBag.XepLoaiHocLucs = _xepLoaiHocLuc.GetXepLoaiHocLucs();
                }
                using (var _chuyenNghanhDaoTao = new ChuyenNganhDaoTaoRepository())
                {
                    ViewBag.ChuyenNganhDaoTaos = _chuyenNghanhDaoTao.GetChuyenNganhDaoTaos();
                }
                using (var _bangTotNghiep = new BangTotNghiepRepository())
                {
                    ViewBag.BangTotNghieps = _bangTotNghiep.GetBangTotNghieps();
                }
                using (var _schoolService = new SchoolRepository())
                {
                    ViewBag.SchoolsCD = _schoolService.GetSchoolsByDistrictAndCapHoc(thuyenChuyen.School.Ward.DistrictID, thuyenChuyen.School.CapTruongId);
                }
                using (var _trinhdoDaoTao = new TrinhDoCaoNhatRepository())
                {
                    ViewBag.TrinhDoCaoNhats = _trinhdoDaoTao.GetTrinhDoCaoNhats();
                }
                ViewBag.ThuyenChuyen = thuyenChuyen;
                return(View());
            }
        }