예제 #1
0
        public static void eliminar(int idPed)
        {
            string sql = String.Format(
                "DELETE FROM APPORDER WHERE idOrder='{0}';",
                idPed);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #2
0
        public static void actualizar(string dir, int idUser)
        {
            string sql = String.Format(
                "UPDATE ADDRESS SET address='{0}' WHERE iduser = {1};",
                dir, idUser);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #3
0
        public static void actualizarContra(string usuario, string nuevaContra)
        {
            string sql = String.Format(
                "UPDATE APPUSER set password='******' where username='******';",
                nuevaContra, usuario);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #4
0
        public static void eliminar(string uname)
        {
            string sql = String.Format(
                "DELETE FROM APPUSER WHERE username='******';",
                uname);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #5
0
        public static void eliminar(string nombre)
        {
            string sql = String.Format(
                "DELETE FROM BUSINESS WHERE name='{0}';",
                nombre);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #6
0
        public static void eliminar(string prod)
        {
            string sql = String.Format(
                "DELETE FROM ADDRESS WHERE address='{0}';",
                prod);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #7
0
        public static void eliminar(string prod)
        {
            string sql = String.Format(
                "DELETE FROM PRODUCT WHERE name='{0}';",
                prod);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #8
0
        public static void Nuevo(string name, string uname, string passwd, bool admin)
        {
            string sql = String.Format(
                "INSERT INTO APPUSER(fullname, username, password, userType) " +
                "VALUES('{0}', '{1}', '{2}' , {3});",
                name, uname, passwd, admin ? "true" : "false");

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #9
0
        public static void Nuevo(int idprod, string nombre)
        {
            string sql = String.Format(
                "INSERT INTO Product(idbusiness, name) " +
                "VALUES({0}, '{1}');",
                idprod, nombre);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #10
0
        public static void Nuevo(int idUser, string dir)
        {
            string sql = String.Format(
                "INSERT INTO ADDRESS(iduser, address) " +
                "VALUES({0}, '{1}');",
                idUser, dir);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #11
0
        public static void Nuevo(string nombre, string desc)
        {
            string sql = String.Format(
                "INSERT INTO BUSINESS(name, description) " +
                "VALUES('{0}', '{1}');",
                nombre, desc);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #12
0
        public static void Nuevo(DateTime fecha, int idprod, int iddir)
        {
            string sql = String.Format(
                "INSERT INTO APPORDER(createDate, idProduct, idAddress) " +
                "VALUES('{0}', {1}, {2});",
                fecha, idprod, iddir);

            ConnectioDB.ExecuteNonQuery(sql);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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);
        }
예제 #16
0
        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);
        }
예제 #17
0
        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);
        }