public void createBlogType(Blog_TypeEntity blogEntity)
 {
     blog_type blogTypeObj = Decorator.getBlogType(blogEntity);
     blogTypeObj.CreateDate = DateTime.Now;
     db.blog_type.Add(blogTypeObj);
     db.SaveChanges();
 }
 public ActionResult Create(Blog_TypeEntity blogType)
 {
     try
     {
         if (!Request.IsAuthenticated)
         {
             return RedirectToAction("Login", "Account");
         }
         // TODO: Add insert logic here
         repo.Add(blogType);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
        public ActionResult Edit(Blog_TypeEntity blog)
        {
            try
            {
                if (!Request.IsAuthenticated)
                {
                    return RedirectToAction("Login", "Account");
                }
                // TODO: Add update logic here

                if (ModelState.IsValid)
                {
                    repo.Update(blog);
                    return RedirectToAction("Index");
                }
                return View(blog);
            }
            catch
            {
                return View();
            }
        }
 public void editBlogType(Blog_TypeEntity blogEntity)
 {
     blogsTypeObj.editBlogType(blogEntity);
 }
 public void createBlogType(Blog_TypeEntity blogEntity)
 {
     blogsTypeObj.createBlogType(blogEntity);
 }
Ejemplo n.º 6
0
        public static Blog_TypeEntity getBlogTypeEntity(blog_type blogTypeObj)
        {
            Blog_TypeEntity blogType = new Blog_TypeEntity();
            blogType.Id = blogTypeObj.Id;
            blogType.Name = blogTypeObj.Name;
            blogType.CreateDate = blogTypeObj.CreateDate;

            return blogType;
        }
Ejemplo n.º 7
0
 public static blog_type getBlogType(Blog_TypeEntity blogTypeObj)
 {
     blog_type blogType = new blog_type();
     blogType.Id = blogTypeObj.Id;
     blogType.Name = blogTypeObj.Name;
     blogType.CreateDate = blogTypeObj.CreateDate;
     return blogType;
 }
 public void editBlogType(Blog_TypeEntity blogEntity)
 {
     blog_type blogTypeObj = Decorator.getBlogType(blogEntity);
     db.Entry(blogTypeObj).State = EntityState.Modified;
     db.SaveChanges();
 }