//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(TS thucuong) { try { cf.TS.Add(thucuong); cf.SaveChanges(); return(true); } catch { return(false); } }
public bool Insert(CTDATHANG chitiet) { try { cf.CTDATHANG.Add(chitiet); cf.SaveChanges(); return(true); } catch { return(false); } }
public int InsertAccount(NHANVIEN tk) { cf.NHANVIEN.Add(tk); cf.SaveChanges(); return(tk.MaNV); }
public int InsertAccount(TAIKHOAN tk) { cf.TAIKHOAN.Add(tk); cf.SaveChanges(); return(tk.ID); }
public int InsertAccount(QUANTRIVIEN tk) { cf.QUANTRIVIEN.Add(tk); cf.SaveChanges(); return(tk.MaQuanTri); }
public int Insert(DONDATHANG dondathang) { cf.DONDATHANG.Add(dondathang); cf.SaveChanges(); return(dondathang.SoDH); }