Exemplo n.º 1
0
 public long Insert(User UserEntity)
 {
     UserEntity.CreateDate = DateTime.Now;
     db.Users.Add(UserEntity);
     db.SaveChanges();
     return(UserEntity.ID);
 }
Exemplo n.º 2
0
 public long Insert(Author AuthorEntity)
 {
     AuthorEntity.CreateDate = DateTime.Now;
     db.Authors.Add(AuthorEntity);
     db.SaveChanges();
     return(AuthorEntity.ID);
 }
Exemplo n.º 3
0
 public long Insert(Slide SlideEntity)
 {
     SlideEntity.CreateDate = DateTime.Now;
     db.Slides.Add(SlideEntity);
     db.SaveChanges();
     return(SlideEntity.ID);
 }
 public int Insert(Feedback FeedbackEntity)
 {
     FeedbackEntity.CreateDate = DateTime.Now;
     db.Feedbacks.Add(FeedbackEntity);
     db.SaveChanges();
     return FeedbackEntity.ID;
 }
 public long Insert(ProductCategory productCategoryEntity)
 {
     productCategoryEntity.CreateDate = DateTime.Now;
     db.ProductCategories.Add(productCategoryEntity);
     db.SaveChanges();
     return(productCategoryEntity.ID);
 }
 public long Insert(Publisher PublisherEntity)
 {
     PublisherEntity.CreateDate = DateTime.Now;
     db.Publishers.Add(PublisherEntity);
     db.SaveChanges();
     return(PublisherEntity.ID);
 }
Exemplo n.º 7
0
 public long Insert(Price PriceEntity)
 {
     PriceEntity.CreateDate = DateTime.Now;
     PriceEntity.Status     = true;
     db.Prices.Add(PriceEntity);
     db.SaveChanges();
     return(PriceEntity.ID);
 }
Exemplo n.º 8
0
 public long Insert(Product ProductEntity)
 {
     ProductEntity.CreateDate = DateTime.Now;
     //ProductEntity.Code = ProductEntity.ProductCategory.MetaTitle + ProductEntity.ID.ToString();
     ProductEntity.IncludeVAT  = true;
     ProductEntity.ViewCount   = 0;
     ProductEntity.WishCount   = 0;
     ProductEntity.SellerCount = 0;
     db.Products.Add(ProductEntity);
     db.SaveChanges();
     return(ProductEntity.ID);
 }
Exemplo n.º 9
0
 public bool Insert(Wish wish)
 {
     try
     {
         db.Wishes.Add(wish);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
 public bool Insert(OrderDetail detail)
 {
     try
     {
         db.OrderDetails.Add(detail);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 11
0
 public bool SetLog(string message, string exception, long userid)
 {
     try
     {
         var log = new Log();
         log.CreateDate = DateTime.Now;
         log.UserID     = userid;
         log.Message    = message;
         log.Exception  = exception;
         db.Logs.Add(log);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 12
0
 public bool Update(About AboutEntity)
 {
     try
     {
         var about = db.Abouts.Find(AboutEntity.ID);
         about.Address      = AboutEntity.Address;
         about.Decription   = AboutEntity.Decription;
         about.Detail       = AboutEntity.Detail;
         about.Email        = AboutEntity.Email;
         about.ModifiedBy   = AboutEntity.ModifiedBy;
         about.ModifiedDate = DateTime.Now;
         about.Name         = AboutEntity.Name;
         about.Phone        = AboutEntity.Phone;
         about.Status       = AboutEntity.Status;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 13
0
 public long Insert(Order order)
 {
     db.Orders.Add(order);
     db.SaveChanges();
     return(order.ID);
 }