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 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 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());
            }
        }