コード例 #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 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));
            }
        }
コード例 #3
0
 public ActionResult ChiTietHoSoNgoaiTinh(int mahoso)
 {
     using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
     {
         ViewBag.ThuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(mahoso);
         return(View());
     }
 }
コード例 #4
0
 public ActionResult DangKiThanhCong(int id)
 {
     using (var _thuyenChuyenService = new ThuyenChuyenNgoaiTinhService())
     {
         ViewBag.ThuyenChuyen = _thuyenChuyenService.GetThuyenChuyensById(id);
         ViewBag.Id           = id;
         return(View());
     }
 }
コード例 #5
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));
     }
 }
コード例 #6
0
        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));
        }