public bool Update(BllBlogEntity item) { var blog = _blogRepository.GetById(item.Id); if (blog == null) return false; _blogRepository.Update(item.ToDal()); _unitOfWork.Commit(); return true; }
public ActionResult Create(BllBlogEntity itemBlog) { if (itemBlog != null && itemBlog.Name.Length > 2) { var username = Request["user"]; itemBlog.User = _userService.Contains(username); _blogService.Create(itemBlog); } return RedirectToAction("Main"); }
public ActionResult Edit(BllBlogEntity itemBlog) { if (itemBlog != null && itemBlog.Name != null) { var updBlog = _blogService.GetById(itemBlog.Id); updBlog.Name = itemBlog.Name; _blogService.Update(updBlog); } return RedirectToAction("Main"); }
public void Create(BllBlogEntity blog) { _blogRepository.Create(blog.ToDal()); _unitOfWork.Commit(); }
public ActionResult Create(string user) { BllBlogEntity blog = new BllBlogEntity { User = new BllUserEntity { Name = user } }; return PartialView("Create", blog); }