예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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);
     }
 }
예제 #5
0
 partial void DeleteDonDatHang(DonDatHang instance);
예제 #6
0
 partial void UpdateDonDatHang(DonDatHang instance);
예제 #7
0
 partial void InsertDonDatHang(DonDatHang instance);