示例#1
0
        public ActionResult SubmitCapNhatDuyet(int Id, RegistrationInterviewDTO registrationInterviewDTO, string ghiChuCanBoSung, int trangthaiId, string lyDoTuChoi)
        {
            int     permisstionId = 7;
            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 (ModelState.IsValid)
            {
                RegistrationInterview registrationInterview = registrationInterviewRepository.GetRegistrationInterviewById(Id);
                registrationInterview.NgayRaXoat = DateTime.Now;
                if (trangthaiId == 2)
                {
                    registrationInterview.GhiChu = ghiChuCanBoSung + " (vào lúc " + DateTime.Now.ToString("HH:mm:ss dd/MM/yyyy") + ")";
                }
                else if (trangthaiId == 3)
                {
                    registrationInterview.LyDoTuChoi = lyDoTuChoi + " (vào lúc " + DateTime.Now.ToString("HH:mm:ss dd/MM/yyyy") + ")";
                }
                registrationInterview.NguoiRaSoat = account.Id;
                registrationInterview.TrangThaiHosoTuyenDungId = trangthaiId;
                Mapper.Map(registrationInterviewDTO, registrationInterview);
                if (registrationInterviewDTO.IsNienChe == false)
                {
                    registrationInterview.DiemLuanVan = null;
                }
                RegistrationInterview registrationInterviewAfterUpdated = registrationInterviewRepository.CapNhatRegistrationInterview(registrationInterview);
                if (registrationInterviewAfterUpdated == null)
                {
                    return(Json(new ReturnResult(400, "failed", null)));
                }
                if (trangthaiId == 1)
                {
                    HoSoHopLe hoSoHopLe = new HoSoHopLe();
                    hoSoHopLe.CreatedAt = DateTime.Now;
                    hoSoHopLe.TienTo    = account.Code.Trim() + DateTime.Now.Year % 100 + "_";
                    hoSoHopLe.HoSoId    = registrationInterview.Id;
                    HoSoHopLe hoSoHopCreated = hoSoHopLeRepository.CreateHoSoHopLe(hoSoHopLe);
                    return(Json(new ReturnResult(200, "Tiếp nhận mã hồ sơ " + registrationInterview.TienTo + registrationInterview.Id + "thành công với mã vòng 2: " + hoSoHopLe.TienTo + hoSoHopLe.MaVong2, registrationInterviewAfterUpdated.Id)));
                }
                else if (trangthaiId == 2)
                {
                    return(Json(new ReturnResult(200, "Ghi nhận cần bổ sung mã hồ sơ " + registrationInterview.TienTo + registrationInterview.Id + "thành công", registrationInterviewAfterUpdated.Id)));
                }
                else if (trangthaiId == 3)
                {
                    return(Json(new ReturnResult(200, "Từ chối mã hồ sơ " + registrationInterview.TienTo + registrationInterview.Id + " thành công", registrationInterviewAfterUpdated.Id)));
                }
            }
            return(Json(new ReturnResult(400, "failed", null)));
        }
示例#2
0
        public ActionResult CheckValidIdentifyCard(int id)
        {
            Account usersession = (Account)Session[CommonConstants.USER_SESSION];

            if (usersession == null || usersession.RoleId != 4 && usersession.RoleId != 2)
            {
                Session.RemoveAll();
                return(RedirectToRoute("login", null));
            }
            RegistrationInterview registrationInterview = registrationInterviewRepository.GetRegistrationInterviewById(id);

            if (registrationInterview == null)
            {
                return(Json(new ResponseResult(403, "Không tìm thấy hồ sơ, vui lòng kiểm tra lại mã hồ sơ", null), JsonRequestBehavior.AllowGet));
            }
            else if (registrationInterview.CreatedAtManagementUnitId != usersession.ManagementUnitId)
            {
                return(Json(new ResponseResult(403, "Hồ sơ này không thuộc về " + usersession.ManagementUnit.Name, null), JsonRequestBehavior.AllowGet));
            }
            else if (registrationInterview.ReviewedBy != null)
            {
                return(Json(new ResponseResult(403, "Hồ sơ này đã được rà xoát", null), JsonRequestBehavior.AllowGet));
            }
            else if (registrationInterview.CreatedAt.Value.Year != DateTime.Now.Year)
            {
                return(Json(new ResponseResult(403, "Hồ sơ này thuộc về năm trước đó", null), JsonRequestBehavior.AllowGet));
            }
            else if (registrationInterview.PhoneNumber == null)
            {
                return(Json(new ResponseResult(403, "Hồ sơ này chưa hoàn tất cập nhật hồ sơ sau khi đăng kí", null), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new ResponseResult(200, "Success", null), JsonRequestBehavior.AllowGet));
            }
        }
示例#3
0
        public ActionResult InMaDangKi(int madangki)
        {
            int     permisstionId = 6;
            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"));
            }
            RegistrationInterview registrationInterview = registrationInterviewRepository.GetRegistrationInterviewById(madangki);

            return(View(registrationInterview));
        }
 public ActionResult SubmitCapNhat(int Id, RegistrationInterviewDTO registrationInterviewDTO)
 {
     if (ModelState.IsValid)
     {
         RegistrationInterview registrationInterview = registrationInterviewRepository.GetRegistrationInterviewById(Id);
         registrationInterview.UpdatedAt = DateTime.Now;
         Mapper.Map(registrationInterviewDTO, registrationInterview);
         if (registrationInterviewDTO.IsNienChe == false)
         {
             registrationInterview.DiemLuanVan = null;
         }
         RegistrationInterview registrationInterviewAfterUpdated = registrationInterviewRepository.CapNhatRegistrationInterview(registrationInterview);
         if (registrationInterviewAfterUpdated == null)
         {
             return(Json(new ReturnResult(400, "failed", null)));
         }
         return(Json(new ReturnResult(200, "success", registrationInterviewAfterUpdated.Id)));
     }
     return(Json(new ReturnResult(400, "failed", null)));
 }