Ejemplo n.º 1
0
        public static List <KhachHang> GetAllKhachHang()
        {
            List <KhachHang> result = new List <KhachHang>();
            List <String[]>  data   = ExecuteQuery.getAll("KhachHang");

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new KhachHang(data[i]));
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static List <HoaDon> GetHDtenKH(String ten)
        {
            List <HoaDon>   result = new List <HoaDon>();
            List <String[]> data   = ExecuteQuery.GetHDtenKH(ten);

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new HoaDon(data[i]));
            }
            return(result);
        }
Ejemplo n.º 3
0
        public static List <ThietBi> GetAllThietBi()
        {
            List <ThietBi>  result = new List <ThietBi>();
            List <String[]> data   = ExecuteQuery.getAll("ThietBi");

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new ThietBi(data[i]));
            }
            return(result);
        }
Ejemplo n.º 4
0
        // Get thiết bị theo loại thiết bị
        public static List <ThietBi> GetThietBiTheoLoai(String loai)
        {
            List <ThietBi>  result = new List <ThietBi>();
            List <String[]> data   = ExecuteQuery.getAll("ThietBi WHERE loai=\'" + loai + "\'");

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new ThietBi(data[i]));
            }
            return(result);
        }
Ejemplo n.º 5
0
        public static List <KhachHang> GetNameKhachhang(string name)
        {
            List <KhachHang> result = new List <KhachHang>();
            List <String[]>  data   = ExecuteQuery.getNameKH(name);

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new KhachHang(data[i]));
            }
            return(result);
        }
Ejemplo n.º 6
0
        public static List <ChiTietHoaDon> GetAllCTHD()
        {
            List <ChiTietHoaDon> result = new List <ChiTietHoaDon>();
            List <String[]>      data   = ExecuteQuery.getAll("CTHoaDon");

            for (int i = 0; i < data.Count(); i++)
            {
                result.Add(new ChiTietHoaDon(data[i]));
            }
            return(result);
        }
Ejemplo n.º 7
0
 public static HoaDon GetHoaDon(String id)
 {
     String[] str = ExecuteQuery.getOne(id, "HoaDon");
     if (str.Count() > 0)
     {
         return(new HoaDon(str));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 8
0
        public static int AddHoaDon(HoaDon hd, List <ChiTietHoaDon> cthd)
        {
            int i = 0;

            Console.Out.Write(hd.ToSQLString());
            if (ExecuteQuery.AddRows(hd.ToSQLString(), "HoaDon") > 0)
            {
                String id = ExecuteQuery.getMahd();
                foreach (ChiTietHoaDon x in cthd)
                {
                    x.Mahd = id;
                    if (CTHDDAO.AddCTHD(x) > 0 && ExecuteQuery.RefeshSL(x.Matb.Matb, x.Soluong) > 0)
                    {
                        i++;
                    }
                }
            }
            return(i);
        }
Ejemplo n.º 9
0
 public static int DeleteKhachHang(KhachHang kh)
 {
     return(ExecuteQuery.DeleteRows(kh.Makh, "KhachHang"));
 }
Ejemplo n.º 10
0
 public static int DeleteThietBi(ChiTietHoaDon cthd)
 {
     return(ExecuteQuery.DeleteRows(cthd.Mahd, "CTHoaDon"));
 }
Ejemplo n.º 11
0
 public static int AddCTHD(ChiTietHoaDon cthd)
 {
     return(ExecuteQuery.AddRows(cthd.ToString(), "CTHoaDon"));
 }
Ejemplo n.º 12
0
 //Xóa thiết bị
 public static int DeleteThietBi(ThietBi tb)
 {
     return(ExecuteQuery.DeleteRows(tb.Matb, "ThietBi"));
 }
Ejemplo n.º 13
0
 //Thêm thiết bị
 public static int AddThietBi(ThietBi tb)
 {
     return(ExecuteQuery.AddRows(tb.ToString(), "ThietBi"));
 }
Ejemplo n.º 14
0
 //Get các loại thiết bị
 public static String[] LoaiTB()
 {
     return(ExecuteQuery.getLoaiTB());
 }
Ejemplo n.º 15
0
 public static ThietBi GetThietBi(String id)
 {
     return(new ThietBi(ExecuteQuery.getOne(id, "ThietBi")));
 }
Ejemplo n.º 16
0
 public static HoaDon GetHoaDon(String id)
 {
     return(new HoaDon(ExecuteQuery.getOne(id, "HoaDon")));
 }
Ejemplo n.º 17
0
 public static int AddHoaDon(HoaDon hd)
 {
     return(ExecuteQuery.AddRows(hd.ToString(), "HoaDon"));
 }
Ejemplo n.º 18
0
 public static int AddKhachHang(KhachHang kh)
 {
     return(ExecuteQuery.AddRows(kh.ToString(), "KhachHang"));
 }
Ejemplo n.º 19
0
 public static KhachHang GetKhachHang(String id)
 {
     return(new KhachHang(ExecuteQuery.getOne(id, "KhachHang")));
 }
Ejemplo n.º 20
0
 public static int DeleteHoaDon(HoaDon hd)
 {
     return(ExecuteQuery.DeleteRows(hd.Mahd, "HoaDon"));
 }