//---------------------------------------------------------------------------------------------------------// 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); }
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); }
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); }
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); }
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); }
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); }
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); }