Exemple #1
0
 public static Get_TKNhanVien_Result GetNhanVien(int value)
 {
     using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
     {
         return(entities.Get_TKNhanVien(value).FirstOrDefault());
     }
 }
Exemple #2
0
 public static List <hd_Result> Search_HoaDonList(string value)
 {
     using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
     {
         return(entities.hd().Where(p => p.ten_HK.Contains(value)).ToList());
     }
 }
Exemple #3
0
 public static List <NhanVien> Search_TTNhanVien(string value)
 {
     try {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.NhanVien.Where(p => p.ten_NV.Contains(value)).ToList());
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #4
0
 public static List <CThd_Result> get_CTListHd()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.CThd().ToList());
         }
     }catch (Exception ex)
     {
         return(null);
     }
 }
Exemple #5
0
 public static List <HD_BanHang> Get_ListHD()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.HD_BanHang.ToList());
         }
     }catch (Exception)
     {
         return(null);
     }
 }
Exemple #6
0
 public static int Get_MaHangSX()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Hang_SX.Max(p => p.ma_Hang));
         }
     }
     catch (Exception)
     {
         return(3000);
     }
 }
Exemple #7
0
 public static List <ChiTiet_HD_Result> get_CTListHd()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             List <ChiTiet_HD_Result> lst = entities.ChiTiet_HD().ToList();
             return(lst);
         }
     }catch (Exception)
     {
         return(null);
     }
 }
 public static List <Nha_CungCap> Search_NhaCC(string key)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Nha_CungCap.Where(p => p.ten_NCC.Contains(key)).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #9
0
 public static int Get_MaKhachHang()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.KhachHang.Max(p => p.ma_KH));
         }
     }
     catch (Exception)
     {
         return(7000);
     }
 }
Exemple #10
0
 public static SanPham Get_SanPham(int maSP)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.SanPham.Where(p => p.ma_SP == maSP).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #11
0
 public static List <Get_SanPhamList_Result> Get_SanPhamList()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Get_SanPhamList().ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public static int Get_MaDanhMuc()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.DanhMuc.Max(p => p.ma_DM));
         }
     }
     catch (Exception)
     {
         return(4000);
     }
 }
Exemple #13
0
 public static Gia_SP Get_GiaSP(int ma_Gia)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Gia_SP.Where(p => p.ma_GiaSP == ma_Gia).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #14
0
 public static Loai_SP Get_LoaiSP(int maLoai)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Loai_SP.Where(p => p.ma_Loai == maLoai).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #15
0
 public static int Get_MaLoaiSP()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Loai_SP.Max(p => p.ma_Loai));
         }
     }
     catch (Exception)
     {
         return(2000);
     }
 }
Exemple #16
0
 public static List <Loai_SP> Search_LoaiSP(string key)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Loai_SP.Where(p => p.ten_Loai.Contains(key)).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #17
0
 public static List <Loai_SP> Get_LoaiSPList()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Loai_SP.ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public static Nha_CungCap Get_NhaCungCap(int ma_NCC)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Nha_CungCap.Where(p => p.ma_NCC == ma_NCC).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public static int Get_MaNhaCungCap()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Nha_CungCap.Max(p => p.ma_NCC));
         }
     }
     catch (Exception)
     {
         return(1000);
     }
 }
 public static List <DanhMuc> Get_DanhMucList()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.DanhMuc.ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public static List <DanhMuc> Search_DanhMuc(string key)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.DanhMuc.Where(p => p.ten_DM.Contains(key)).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #22
0
 public static int Get_MaGiaSP()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Gia_SP.Max(p => p.ma_GiaSP));
         }
     }
     catch (Exception)
     {
         return(10000);
     }
 }
 public static DanhMuc Get_DanhMuc(int maDM)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.DanhMuc.Where(p => p.ma_DM == maDM).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #24
0
 public static List <NhanVien> getNhanvien_List()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.NhanVien.ToList());
         }
     }
     catch
     {
         return(null);
     }
 }
Exemple #25
0
 public static int Get_MaSanPham()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.SanPham.Max(p => p.ma_SP));
         }
     }
     catch (Exception)
     {
         return(14000);
     }
 }
Exemple #26
0
 public static List <Hang_SX> Search_HangSX(string key)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Hang_SX.Where(p => p.ten_Hang.Contains(key)).ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #27
0
 public static List <KhachHang> Get_KhachHangList()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.KhachHang.ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #28
0
 public static Hang_SX Get_HangSX(int ma_Hang)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Hang_SX.Where(p => p.ma_Hang == ma_Hang).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemple #29
0
 public static KhachHang Get_KhachHang(int maKH)
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.KhachHang.Where(p => p.ma_KH == maKH).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public static List <Nha_CungCap> Get_NhaCungCapList()
 {
     try
     {
         using (CuaHang_XeMayEntities entities = new CuaHang_XeMayEntities())
         {
             return(entities.Nha_CungCap.ToList());
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }