Exemplo n.º 1
0
        public string ReturnID(string email)
        {
            string    sql = string.Format($@"SELECT id FROM provider WHERE email = '{email}';");
            DataTable dt  = connection.QueryExecution(sql);

            if (dt.Rows.Count == 1)
            {
                Console.WriteLine(dt.Rows[0]["id"].ToString());
                return(dt.Rows[0]["id"].ToString());
            }
            else
            {
                return("NOT_FOUND");
            }
        }
        public string ReturnID(string cep)
        {
            string    sql = string.Format($@"SELECT id FROM address WHERE cep = '{cep}';");
            DataTable dt  = connection.QueryExecution(sql);

            if (dt.Rows.Count == 1)
            {
                Console.WriteLine(dt.Rows[0]["id"].ToString());
                return(dt.Rows[0]["id"].ToString());
            }
            else
            {
                return("NOT_FOUND");
            }
        }
Exemplo n.º 3
0
        public Boolean Authenticator(string email, string pass)
        {
            string    sql = string.Format($@"SELECT * FROM client WHERE email = '{email}' AND password = '******';");
            DataTable dt  = connection.QueryExecution(sql);

            if (dt.Rows.Count == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public DataTable ConsultId(int Id)
        {
            string sql = string.Format($@"SELECT * FROM product WHERE id = '{Id}';");

            return(connection.QueryExecution(sql));
        }
Exemplo n.º 5
0
        public DataTable ConsultID(int id)
        {
            string sql = string.Format($@"SELECT * FROM category WHERE id = '{id}';");

            return(connection.QueryExecution(sql));
        }