示例#1
0
 public bool Update(BllBlogEntity item)
 {
     var blog = _blogRepository.GetById(item.Id);
     if (blog == null)
         return false;
     _blogRepository.Update(item.ToDal());
     _unitOfWork.Commit();
     return true;
 }
示例#2
0
 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");
 }
示例#3
0
 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");
 }
示例#4
0
 public void Create(BllBlogEntity blog)
 {
     _blogRepository.Create(blog.ToDal());
     _unitOfWork.Commit();
 }
示例#5
0
 public ActionResult Create(string user)
 {
     BllBlogEntity blog = new BllBlogEntity { User = new BllUserEntity { Name = user } };
     return PartialView("Create", blog);
 }