public long Insert(User UserEntity) { UserEntity.CreateDate = DateTime.Now; db.Users.Add(UserEntity); db.SaveChanges(); return(UserEntity.ID); }
public long Insert(Author AuthorEntity) { AuthorEntity.CreateDate = DateTime.Now; db.Authors.Add(AuthorEntity); db.SaveChanges(); return(AuthorEntity.ID); }
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); }
public long Insert(Price PriceEntity) { PriceEntity.CreateDate = DateTime.Now; PriceEntity.Status = true; db.Prices.Add(PriceEntity); db.SaveChanges(); return(PriceEntity.ID); }
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); }
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); } }
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); } }
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); } }
public long Insert(Order order) { db.Orders.Add(order); db.SaveChanges(); return(order.ID); }