Пример #1
0
 public ActionResult Create(TeamMember team)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var obj = new FileUploadHelper();
             var filename = obj.SaveImages();
             if (filename == obj.ErrorMessage)
             {
                 ModelState.AddModelError("ImageUpload Error", filename);
                 return View(team);
             }
             team.ImageUrl = filename;
             ObjTeamMemberService.Add(team);
             return RedirectToAction("Index");
         }
         else
         {
             return View(team);
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("Error", ex.Message);
         return View(team);
     }
 }
 public void Delete(TeamMember entity)
 {
     throw new System.NotImplementedException();
 }
 public TeamMember Update(TeamMember entity)
 {
     throw new System.NotImplementedException();
 }
 public TeamMember Add(TeamMember entity)
 {
     entity = teamMemberRepository.Add(entity);
     unitOfWork.Commit();
     return entity;
 }