예제 #1
0
 public long InsertAboutMe(tbl_AboutMe about)
 {
     about.CreatedDate = DateTime.Now;
     about.MetaTitle   = XuLyChuoi.GetMetaTitle(about.Title);
     db.tbl_AboutMe.Add(about);
     return(about.ID);
 }
예제 #2
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);
 }
예제 #3
0
 public bool Update(tbl_CategoriesPosts category)
 {
     try
     {
         var cate = db.tbl_CategoriesPosts.Find(category.ID);
         cate.CategoryName = category.CategoryName;
         cate.MetaTitle    = XuLyChuoi.GetMetaTitle(cate.CategoryName);
         cate.ModifiedDate = DateTime.Now;
         cate.Status       = category.Status;
         cate.ModifiedBy   = category.ModifiedBy;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #4
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);
     }
 }