//xử lý public bool Insert(OrderDetail entity) { try { db.OrderDetails.Add(entity); db.SaveChanges(); return(true); } catch { return(false); } }
public bool Insert(About entity) { db.Abouts.Add(entity); db.SaveChanges(); return(true); }
//public IEnumerable<UserViewModel> List(string searchString, int page, int pagesize) //{ // var query = (from u in db.Users // join g in db.UserGroups // on u.UserGroupID equals g.UserGroupID // select new // { // UserID = u.UserID, // UserName = u.UserName, // Password = u.Password, // FullName = u.FullName, // Birthday = u.Birthday, // Gender = u.Gender, // Address = u.Address, // Email = u.Email, // Phone = u.Phone, // CreatedDate = u.CreatedDate, // Status = u.Status, // UserGroupID = u.UserGroupID, // UserGroupName = g.Name // }).AsEnumerable().Select(x => new UserViewModel() // { // UserID = x.UserID, // UserName = x.UserName, // Password = x.Password, // FullName = x.FullName, // Birthday = x.Birthday, // Gender = x.Gender, // Address = x.Address, // Email = x.Email, // Phone = x.Phone, // Status = x.Status, // UserGroupID = x.UserGroupID, // UserGroupName = x.UserGroupName // }); // if (!string.IsNullOrEmpty(searchString)) // { // query = query.Where(x => x.UserName.Contains(searchString) || x.FullName.Contains(searchString)); // } // query.OrderBy(x => x.UserID).ToPagedList(page, pagesize); // return query.ToList(); //} public long Insert(User entity) { db.Users.Add(entity); db.SaveChanges(); return(entity.ID); }
/// <summary> /// Các hàm xử lý /// </summary> /// <param name="entity"></param> /// <returns></returns> public long Insert(ProductCategory entity) { db.ProductCategories.Add(entity); db.SaveChanges(); return(entity.ID); }
public bool Insert(UserGroup entity) { db.UserGroups.Add(entity); db.SaveChanges(); return(true); }
public bool Insert(Contact entity) { db.Contacts.Add(entity); db.SaveChanges(); return(true); }
//xử lý public long Insert(Menu entity) { db.Menus.Add(entity); db.SaveChanges(); return(entity.ID); }
//Xử lý public long Insert(Slide entity) { db.Slides.Add(entity); db.SaveChanges(); return(entity.ID); }
public int Insert(MenuType entity) { db.MenuTypes.Add(entity); db.SaveChanges(); return(entity.ID); }
public bool Insert(Feedback entity) { db.Feedbacks.Add(entity); db.SaveChanges(); return(true); }
public bool Insert(Footer entity) { db.Footers.Add(entity); db.SaveChanges(); return(true); }
public bool Insert(Role entity) { db.Roles.Add(entity); db.SaveChanges(); return(true); }
//Xử lý public long Insert(Product entity) { db.Products.Add(entity); db.SaveChanges(); return(entity.ID); }