public bool DeleteDDH(int maddh) { try { DonDatHang m = db.DonDatHangs.Single(ddh => ddh.MaDDH == maddh); db.DonDatHangs.DeleteOnSubmit(m); db.SubmitChanges(); return(true); } catch { return(false); } }
public bool UpdateDDH(int maddh, string tenKH, string sdt, string email, string diachi) { try { DonDatHang m = db.DonDatHangs.Single(ddh => ddh.MaDDH == maddh); m.TenKhachHang = tenKH; m.SDT = sdt; m.Email = email; m.DiaChi = diachi; db.SubmitChanges(); return(true); } catch { return(false); } }
public bool InsertDDH(string tenKH, string sdt, string email, string diachi) { try { DonDatHang m = new DonDatHang(); m.TenKhachHang = tenKH; m.SDT = sdt; m.Email = email; m.DiaChi = diachi; db.DonDatHangs.InsertOnSubmit(m); db.SubmitChanges(); return(true); } catch { return(false); } }
public int GetMaDDH_InsertDDH(string tenKH, string sdt, string email, string diachi) { try { DonDatHang m = new DonDatHang(); m.TenKhachHang = tenKH; m.SDT = sdt; m.Email = email; m.DiaChi = diachi; db.DonDatHangs.InsertOnSubmit(m); db.SubmitChanges(); return(m.MaDDH); } catch { return(0); } }
partial void DeleteDonDatHang(DonDatHang instance);
partial void UpdateDonDatHang(DonDatHang instance);
partial void InsertDonDatHang(DonDatHang instance);