public int ThemNCC(NhaCungCap n) { try { db.NhaCungCaps.InsertOnSubmit(n); db.SubmitChanges(); } catch { return -1; } return 1; }
public int SuaNCC(NhaCungCap n) { try { NhaCungCap ncc = db.NhaCungCaps.Single(a => a.id == n.id); ncc.ten = n.ten; ncc.sdt = n.sdt; ncc.diachi = n.diachi; ncc.sdt = n.sdt; db.SubmitChanges(); } catch { return -1; } return 1; }
partial void UpdateNhaCungCap(NhaCungCap instance);
partial void DeleteNhaCungCap(NhaCungCap instance);
partial void InsertNhaCungCap(NhaCungCap instance);