public static List <Business> getLista() { DataTable dt = ConnectioDB.ExecuteQuery("SELECT * FROM BUSINESS"); List <Business> lista = new List <Business>(); foreach (DataRow columna in dt.Rows) { var b = new Business(); b.id_Business = Convert.ToInt32(columna[0].ToString()); b.name = columna[1].ToString(); b.descrption = columna[2].ToString(); lista.Add(b); } return(lista); }
public static List <Product> getLista() { DataTable dt = ConnectioDB.ExecuteQuery("SELECT * FROM PRODUCT"); List <Product> lista = new List <Product>(); foreach (DataRow columna in dt.Rows) { var p = new Product(); p.id_product = Convert.ToInt32(columna[0].ToString()); p.id_business = Convert.ToInt32(columna[1].ToString()); p.name = columna[2].ToString(); lista.Add(p); } return(lista); }
public static List <Direccion> getLista() { DataTable dt = ConnectioDB.ExecuteQuery("SELECT * FROM ADDRESS"); List <Direccion> lista = new List <Direccion>(); foreach (DataRow columna in dt.Rows) { var d = new Direccion(); d.idaddres = Convert.ToInt32(columna[0].ToString()); d.iduser = Convert.ToInt32(columna[1].ToString()); d.addres = columna[2].ToString(); lista.Add(d); } return(lista); }
public static List <Orden> getLista() { DataTable dt = ConnectioDB.ExecuteQuery("SELECT * FROM APPORDER"); List <Orden> lista = new List <Orden>(); foreach (DataRow columna in dt.Rows) { var o = new Orden(); o.idorder = Convert.ToInt32(columna[0].ToString()); o.createdate = DateTime.Parse(columna[1].ToString()); o.idproduct = Convert.ToInt32(columna[2].ToString()); o.idaddres = Convert.ToInt32(columna[3].ToString()); lista.Add(o); } return(lista); }
public static List <Usuario> getLista() { DataTable dt = ConnectioDB.ExecuteQuery("SELECT * FROM APPUSER"); List <Usuario> lista = new List <Usuario>(); foreach (DataRow columna in dt.Rows) { var u = new Usuario(); u.id_user = Convert.ToInt32(columna[0].ToString()); u.fullname = columna[1].ToString(); u.username = columna[2].ToString(); u.password = columna[3].ToString(); u.userType = Convert.ToBoolean(columna[4].ToString()); lista.Add(u); } return(lista); }