Ejemplo n.º 1
0
 public ActionResult SaveCreate(CreateHoSoUngVienModel model, HttpPostedFileBase AvatarUser, List <string> name_FileHoSoUngVien, List <HttpPostedFileBase> FileHoSoUngVien)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var EntityModel = _mapper.Map <TD_HoSoUngVien>(model);
             _hoSoUngVienService.Create(EntityModel);
             if (FileHoSoUngVien != null && FileHoSoUngVien.Any())
             {
                 var resultfield = _taiLieuDinhKemService.SaveMultiFile(LoaiTaiLieuUploadConstant.HoSoUngVien, EntityModel.Id, FileHoSoUngVien, name_FileHoSoUngVien, null, null, LoaiTaiLieuUploadConstant.HoSoUngVien, HostingEnvironment.MapPath("/Uploads"), CurrentUserId);
                 if (!resultfield.Status)
                 {
                     TempData["MessageError"] = resultfield.Message;
                 }
             }
             TempData["MessageSuccess"] = "Tạo hồ sơ ứng viên thành công";
             return(RedirectToAction("Index"));
         }
         TempData["MessageError"] = "Lỗi dữ liệu";
         return(RedirectToAction("Create"));
     }
     catch (Exception ex)
     {
         _loger.Error("Lỗi khi lưu thông tin ứng viên", ex);
         throw new HttpException("Lỗi khi lưu dữ liệu hồ sơ ứng viên", ex);
     }
 }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            ViewBag.DanTocDropdownData       = _DulieuDanhmucService.GetDropdownlist(DanhMucConstant.DanToc, string.Empty).AddDefault("--Chọn dân tộc--");
            ViewBag.TonGiaoDropdownData      = _DulieuDanhmucService.GetDropdownlist(DanhMucConstant.TonGiao, string.Empty).AddDefault("--Chọn tôn giáo--");
            ViewBag.QuocGiaDropdownData      = _DulieuDanhmucService.GetDropdownlist(DanhMucConstant.QuocGia, string.Empty).AddDefault("--Chọn quốc tịch--");
            ViewBag.XuatThanDropdownData     = _DulieuDanhmucService.GetDropdownlist(DanhMucConstant.XuatThan, string.Empty).AddDefault("--Chọn xuất thân--");
            ViewBag.KenhUngTuyenDropdownData = _DulieuDanhmucService.GetDropdownlist(DanhMucConstant.KenhUngTuyen, string.Empty).AddDefault("--Chọn kênh ứng tuyển--");
            ViewBag.DotTuyenDung             = _DotTuyenDungService.DropdownListDotTuyenDung().AddDefault("--Chọn đợt tuyển dụng--");

            var model = new CreateHoSoUngVienModel();

            return(View(model));
        }