Esempio n. 1
0
 public static void Delete(string SOHOADON, string MASP)
 {
     SqlParameter[] pr = new SqlParameter[2];
     pr[0] = new SqlParameter(@"SOHOADON", SOHOADON);
     pr[1] = new SqlParameter(@"MASP", MASP);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "CHITIETHOADON_Delete", pr);
 }
Esempio n. 2
0
 public static void Update(ELOAISANPHAM OLOAISANPHAM)
 {
     SqlParameter[] pr = new SqlParameter[3];
     pr[0] = new SqlParameter(@"MAL", OLOAISANPHAM.MAL);
     pr[1] = new SqlParameter(@"TENL", OLOAISANPHAM.TENL);
     pr[2] = new SqlParameter(@"MOTA", OLOAISANPHAM.MOTA);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "LOAISANPHAM_Update", pr);
 }
Esempio n. 3
0
//---------------------------------------------------------------------------------------------------------//
        public static DataTable SelectAll(string shd)
        {
            SqlParameter[] pr = new SqlParameter[1];
            pr[0] = new SqlParameter(@"SoHoaDon", shd);
            DataTable all = DataAccseL.ExecuteData(CommandType.StoredProcedure, "CHITIETHOADON_SelectAll", pr);

            return(all);
        }
Esempio n. 4
0
 public static bool TestByID(string MASP)
 {
     SqlParameter[] pr = new SqlParameter[1];
     pr[0]           = new SqlParameter(@"MASP", MASP);
     pr[0].Direction = ParameterDirection.Output;
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "SANPHAM_TestByID", pr);
     return(Convert.ToBoolean(pr[0].Value));
 }
Esempio n. 5
0
        public static DataTable SelectAll(string makh)
        {
            SqlParameter[] pr = new SqlParameter[1];
            pr[0] = new SqlParameter(@"MaKH", makh);
            DataTable all = DataAccseL.ExecuteData(CommandType.StoredProcedure, "KHACHHANG_Select", pr);

            return(all);
        }
Esempio n. 6
0
 public static void Update(ECHITIETHOADON OCHITIETHOADON)
 {
     SqlParameter[] pr = new SqlParameter[4];
     pr[0] = new SqlParameter(@"SOHOADON", OCHITIETHOADON.SOHOADON);
     pr[1] = new SqlParameter(@"MASP", OCHITIETHOADON.MASP);
     pr[2] = new SqlParameter(@"SOLUONG", OCHITIETHOADON.SOLUONG);
     pr[3] = new SqlParameter(@"CHIETKHAU", OCHITIETHOADON.CHIETKHAU);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "CHITIETHOADON_Update", pr);
 }
Esempio n. 7
0
 public static void Update(ESANPHAM OSANPHAM)
 {
     SqlParameter[] pr = new SqlParameter[5];
     pr[0] = new SqlParameter(@"MASP", OSANPHAM.MASP);
     pr[1] = new SqlParameter(@"TENSP", OSANPHAM.TENSP);
     pr[2] = new SqlParameter(@"MAL", OSANPHAM.MAL);
     pr[3] = new SqlParameter(@"DONGIA", OSANPHAM.DONGIA);
     pr[4] = new SqlParameter(@"MOTA", OSANPHAM.MOTA);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "SANPHAM_Update", pr);
 }
Esempio n. 8
0
        public static DataTable SelectTop(string Top, string Where, string Order)
        {
            SqlParameter[] pr = new SqlParameter[3];
            pr[0] = new SqlParameter(@"Top", Top);
            pr[1] = new SqlParameter(@"Where", Where);
            pr[2] = new SqlParameter(@"Order", Order);
            DataTable all = DataAccseL.ExecuteData(CommandType.StoredProcedure, "SANPHAM_SelectTop", pr);

            return(all);
        }
Esempio n. 9
0
 public static void Update(EKHACHHANG OKHACHHANG)
 {
     SqlParameter[] pr = new SqlParameter[5];
     pr[0] = new SqlParameter(@"MAKH", OKHACHHANG.MAKH);
     pr[1] = new SqlParameter(@"TENK", OKHACHHANG.TENK);
     pr[2] = new SqlParameter(@"GIOITINH", OKHACHHANG.GIOITINH);
     pr[3] = new SqlParameter(@"SDT", OKHACHHANG.SDT);
     pr[4] = new SqlParameter(@"DIACHI", OKHACHHANG.DIACHI);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "KHACHHANG_Update", pr);
 }
Esempio n. 10
0
 public static void Update(EHOADON OHOADON)
 {
     SqlParameter[] pr = new SqlParameter[5];
     pr[0] = new SqlParameter(@"SOHOADON", OHOADON.SOHOADON);
     pr[1] = new SqlParameter(@"NGAYHOADON", OHOADON.NGAYHOADON);
     pr[2] = new SqlParameter(@"MAKH", OHOADON.MAKH);
     pr[3] = new SqlParameter(@"NHANVIEN", OHOADON.NHANVIEN);
     pr[4] = new SqlParameter(@"GHICHU", OHOADON.GHICHU);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "HOADON_Update", pr);
 }
Esempio n. 11
0
        public static DataTable SelectPage(int CurrentPage, int PageSize, out int RowCount)
        {
            SqlParameter[] pr = new SqlParameter[3];
            pr[0]           = new SqlParameter(@"CurrentPage", CurrentPage);
            pr[1]           = new SqlParameter(@"PageSize", PageSize);
            pr[2]           = new SqlParameter(@"RowCount", SqlDbType.Int);
            pr[2].Direction = ParameterDirection.Output;
            DataTable all = DataAccseL.ExecuteData(CommandType.StoredProcedure, "SANPHAM_SelectPage", pr);

            RowCount = Convert.ToInt32(pr[2].Value);
            return(all);
        }
Esempio n. 12
0
        public static EHOADON SelectByID(string SOHOADON)
        {
            EHOADON OHOADON = new EHOADON();

            SqlParameter[] pr = new SqlParameter[1];
            pr[0] = new SqlParameter(@"SOHOADON", SOHOADON);
            IDataReader idr = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "HOADON_SelectByID", pr);

            if (idr.Read())
            {
                OHOADON = GetOneHOADON(idr);
            }
            idr.Close();
            idr.Dispose();
            return(OHOADON);
        }
Esempio n. 13
0
        public static ESANPHAM SelectByID(string MASP)
        {
            ESANPHAM OSANPHAM = new ESANPHAM();

            SqlParameter[] pr = new SqlParameter[1];
            pr[0] = new SqlParameter(@"MASP", MASP);
            IDataReader idr = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "SANPHAM_SelectByID", pr);

            if (idr.Read())
            {
                OSANPHAM = GetOneSANPHAM(idr);
            }
            idr.Close();
            idr.Dispose();
            return(OSANPHAM);
        }
Esempio n. 14
0
        public static EKHACHHANG SelectByID(string MAKH)
        {
            EKHACHHANG OKHACHHANG = new EKHACHHANG();

            SqlParameter[] pr = new SqlParameter[1];
            pr[0] = new SqlParameter(@"MAKH", MAKH);
            IDataReader idr = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "KHACHHANG_SelectByID", pr);

            if (idr.Read())
            {
                OKHACHHANG = GetOneKHACHHANG(idr);
            }
            idr.Close();
            idr.Dispose();
            return(OKHACHHANG);
        }
Esempio n. 15
0
//---------------------------------------------------------------------------------------------------------//
        public static List <ESANPHAM> ListAll()
        {
            List <ESANPHAM> list = new List <ESANPHAM>();
            IDataReader     idr  = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "SANPHAM_SelectAll", null);

            while (idr.Read())
            {
                list.Add(GetOneSANPHAM(idr));
            }
            if (idr.IsClosed == false)
            {
                idr.Close();
                idr.Dispose();
            }
            return(list);
        }
Esempio n. 16
0
        public static ECHITIETHOADON SelectByID(string SOHOADON, string MASP)
        {
            ECHITIETHOADON OCHITIETHOADON = new ECHITIETHOADON();

            SqlParameter[] pr = new SqlParameter[2];
            pr[0] = new SqlParameter(@"SOHOADON", SOHOADON);
            pr[1] = new SqlParameter(@"MASP", MASP);
            IDataReader idr = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "CHITIETHOADON_SelectByID", pr);

            if (idr.Read())
            {
                OCHITIETHOADON = GetOneCHITIETHOADON(idr);
            }
            idr.Close();
            idr.Dispose();
            return(OCHITIETHOADON);
        }
Esempio n. 17
0
        public static List <ESANPHAM> ListTop(string Top, string Where, string Order)
        {
            SqlParameter[] pr = new SqlParameter[3];
            pr[0] = new SqlParameter(@"Top", Top);
            pr[1] = new SqlParameter(@"Where", Where);
            pr[2] = new SqlParameter(@"Order", Order);
            List <ESANPHAM> list = new List <ESANPHAM>();
            IDataReader     idr  = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "SANPHAM_SelectTop", pr);

            while (idr.Read())
            {
                list.Add(GetOneSANPHAM(idr));
            }
            if (idr.IsClosed == false)
            {
                idr.Close();
                idr.Dispose();
            }
            return(list);
        }
Esempio n. 18
0
        public static List <ESANPHAM> ListPage(int CurrentPage, int PageSize, out int RowCount)
        {
            SqlParameter[] pr = new SqlParameter[3];
            pr[0]           = new SqlParameter(@"CurrentPage", CurrentPage);
            pr[1]           = new SqlParameter(@"PageSize", PageSize);
            pr[2]           = new SqlParameter(@"RowCount", SqlDbType.Int);
            pr[2].Direction = ParameterDirection.Output;
            List <ESANPHAM> list = new List <ESANPHAM>();
            IDataReader     idr  = DataAccseL.ExecuteReader(CommandType.StoredProcedure, "SANPHAM_SelectPage", pr);

            while (idr.Read())
            {
                list.Add(GetOneSANPHAM(idr));
            }
            if (idr.IsClosed == false)
            {
                idr.Close();
                idr.Dispose();
            }
            RowCount = Convert.ToInt32(pr[2].Value);
            return(list);
        }
Esempio n. 19
0
//---------------------------------------------------------------------------------------------------------//
        public static DataTable SelectAll()
        {
            DataTable all = DataAccseL.ExecuteData(CommandType.StoredProcedure, "SANPHAM_SelectAll", null);

            return(all);
        }
Esempio n. 20
0
 public static void Delete(string MASP)
 {
     SqlParameter[] pr = new SqlParameter[1];
     pr[0] = new SqlParameter(@"MASP", MASP);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "SANPHAM_Delete", pr);
 }
Esempio n. 21
0
 public static void Delete(string MAKH)
 {
     SqlParameter[] pr = new SqlParameter[1];
     pr[0] = new SqlParameter(@"MAKH", MAKH);
     DataAccseL.ExecuteNonQuery(CommandType.StoredProcedure, "KHACHHANG_Delete", pr);
 }