public ActionResult Create(UserResume userresume)
        {
            if (ModelState.IsValid)
            {
                HttpPostedFileBase postedFile = HttpContext.Request.Files.Count > 0 ? HttpContext.Request.Files[0] : null;
                string fileName = string.Empty;

                if (postedFile != null && postedFile.InputStream != null && !string.IsNullOrWhiteSpace(postedFile.FileName))
                {
                    fileName = WriteResumeToDisk(postedFile);
                    userresume.ResumeFilePath = fileName;
                }

                _userResumeRepository.Add(userresume);
                _userResumeRepository.SaveChanges();

                return RedirectToAction("Index");
            }
            return View(userresume);
        }
Пример #2
0
 public void Add(UserResume userResume)
 {
     this.Context.UserResume.Add(userResume);
 }