Esempio n. 1
0
 public long Insert(tbl_ImagePosts imagePosts)
 {
     imagePosts.Status = true;
     db.tbl_ImagePosts.Add(imagePosts);
     db.SaveChanges();
     return(imagePosts.ID);
 }
Esempio n. 2
0
 public long Insert(tbl_Slide slide)
 {
     slide.CreatedDate = DateTime.Now;
     db.tbl_Slide.Add(slide);
     db.SaveChanges();
     return(slide.ID);
 }
Esempio n. 3
0
 public long Insert(tbl_CategoriesPosts categoriesPosts)
 {
     categoriesPosts.CratedDate = DateTime.Now;
     categoriesPosts.MetaTitle  = XuLyChuoi.GetMetaTitle(categoriesPosts.CategoryName);
     db.tbl_CategoriesPosts.Add(categoriesPosts);
     db.SaveChanges();
     return(categoriesPosts.ID);
 }
Esempio n. 4
0
 public long Insert(tbl_FeedBack feedBack)
 {
     feedBack.CreatedDate = DateTime.Now;
     feedBack.Status      = true;
     feedBack.CreatedDate = DateTime.Now;
     db.tbl_FeedBack.Add(feedBack);
     db.SaveChanges();
     return(feedBack.ID);
 }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "ID,UserName,PassWord,Avatar,CreatedDate,CreatedBy,ModifiedDate,ModifiedBy,Status,IsAdmin")] tbl_UserName tbl_UserName)
        {
            if (ModelState.IsValid)
            {
                db.tbl_UserName.Add(tbl_UserName);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_UserName));
        }
Esempio n. 6
0
        public ActionResult Create([Bind(Include = "ID,Title,ContentPost,MetaTitle,DisplayOrder,CategoriesID,CreatedDate,CreatedBy,ModifiedDate,ModifiedBy,MetaKeywords,Status,TagID")] tbl_Posts tbl_Posts)
        {
            if (ModelState.IsValid)
            {
                db.tbl_Posts.Add(tbl_Posts);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CategoriesID = new SelectList(db.tbl_CategoriesPosts, "ID", "CategoryName", tbl_Posts.CategoriesID);
            return(View(tbl_Posts));
        }
Esempio n. 7
0
 public bool Update(tbl_Footer footer)
 {
     try
     {
         var foot = db.tbl_Footer.Find(footer.ID);
         foot.Contents     = footer.Contents;
         foot.ModifiedDate = DateTime.Now;
         foot.Status       = footer.Status;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 8
0
 public long Insert(tbl_UserName user)
 {
     user.CreatedDate = DateTime.Now;
     db.tbl_UserName.Add(user);
     db.SaveChanges();
     return(user.ID);
 }
Esempio n. 9
0
        public bool Update(tbl_TypeMenu typeMenu)
        {
            try
            {
                var entity = db.tbl_TypeMenu.Find(typeMenu.ID);
                entity.Name = typeMenu.Name;
                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);

                throw;
            }
        }
Esempio n. 10
0
 public bool Update(tbl_AboutMe aboutMe)
 {
     try
     {
         var about = db.tbl_AboutMe.Find(aboutMe.ID);
         about.FirstName    = aboutMe.FirstName;
         about.LastName     = aboutMe.LastName;
         about.Title        = aboutMe.Title;
         about.MetaTitle    = XuLyChuoi.GetMetaTitle(about.Title);
         about.Introduce    = aboutMe.Introduce;
         about.Image        = aboutMe.Image;
         about.MoreImage    = aboutMe.MoreImage;
         about.ModifiedDate = DateTime.Now;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 11
0
 public long Insert(tbl_Menu menu)
 {
     db.tbl_Menu.Add(menu);
     db.SaveChanges();
     return(menu.ID);
 }