public bool Insert(ChiNhanh chinhanh) { try { cf.ChiNhanhs.Add(chinhanh); cf.SaveChanges(); return(true); } catch { return(false); } }
//public List<FoodViewModel> Search(string keyword) //{ // var model = (from a in cf.ThucUong // join b in cf.FoodCategory // on a.IDCategory equals b.ID // where a.Name.Contains(keyword) // select new // { // ID = a.ID, // CateName = b.Name, // UrlTitle = a.UrlTitle, // Price = a.Price, // Detail = a.Detail, // Description = a.Description, // Name = a.Name, // Image = a.Image, // }).AsEnumerable().Select(x => new FoodViewModel() // { // ID = x.ID, // CateName = x.Name, // UrlTitle = x.UrlTitle, // Price = x.Price, // Detail = x.Detail, // Description = x.Description, // Name = x.Name, // Image = x.Image, // }); // //model.OrderByDescending(x => x.ID).Skip((pageIndex - 1) * pageSize).Take(pageSize); // return model.ToList(); //} public bool Insert(ThucUong thucuong) { try { cf.ThucUongs.Add(thucuong); cf.SaveChanges(); return(true); } catch { return(false); } }
public bool SendFeedBack(Feedback feed) { try { cf.Feedbacks.Add(feed); cf.SaveChanges(); return(true); } catch { return(false); } }
public bool Insert(Customer customer) { try { cf.Customers.Add(customer); cf.SaveChanges(); return(true); } catch { return(false); } }
public bool Insert(ThongTinDatHang chitiet) { try { cf.ThongTinDatHangs.Add(chitiet); cf.SaveChanges(); return(true); } catch { return(false); } }
public bool InsertMenu(ThucDon menu) { try { cf.ThucDons.Add(menu); cf.SaveChanges(); return(true); } catch { return(false); } }
public int Insert(DatHang dondathang) { cf.DatHangs.Add(dondathang); cf.SaveChanges(); return(dondathang.ID); }
public int InsertAccount(TaiKhoan tk) { cf.TaiKhoans.Add(tk); cf.SaveChanges(); return(tk.ID); }