Beispiel #1
0
    public static DataSet EmpresaUsuarioPerfil(int emp_id)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        string sql = " select pro.*, img.* " +
                     "from pro_produto pro " +
                     "inner join img_imagem img " +
                     "on pro.pro_id = img.pro_id " +
                     "where emp_id = ?emp_id;";

        objConnection = Mapped.Connection();
        objCommand    = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?emp_id", emp_id));


        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
Beispiel #2
0
    public static DataSet SelectPorCidade(string cidade)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = " select emp_nome_fantasia " +
                     "from emp_empresa emp " +
                     "inner join end_endereco end " +
                     "on emp.end_id = end.end_id " +
                     "inner join bai_bairro bai " +
                     "on bai.bai_id = end.bai_id " +
                     "inner join cid_cidade cid " +
                     "on cid.cid_id = bai.cid_id " +
                     "where cid.cid_nome = ?cid_nome;";


        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?cid_nome", cidade));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
    public static DataSet SelectAll()
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from bai_bairro";

        objCommand = Mapped.Command(sql, objConnection);

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
    public static DataSet SelectBairro(int bai_id)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from bai_bairro where bai_id= ?bai_id";

        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?bai_id", bai_id));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
    public static DataSet SelectID(int img_id)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from img_imagem where img_id= ?img_id";

        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?img_id", img_id));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
Beispiel #6
0
    public static DataSet SelectCid(int cid_id)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from cid_cidade inner join est_estado e using (est_id) where cid_id = ?cid_id";

        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?cid_id", cid_id));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
    public static DataSet SelectEndereco(int cli_id)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from cle_cliente_endereco where cli_id = ?cli_id";

        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?cli_id", cli_id));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }
Beispiel #8
0
    public static DataSet SelectLogin(string email, string pwd)
    {
        DataSet       ds = new DataSet();
        IDbConnection objConnection;
        IDbCommand    objCommand;
        IDataAdapter  objDataDadapter;

        objConnection = Mapped.Connection();
        string sql = "select * from cli_cliente where cli_email = ?cli_email and cli_senha = ?cli_senha";

        objCommand = Mapped.Command(sql, objConnection);

        objCommand.Parameters.Add(Mapped.Parameter("?cli_email", email));
        objCommand.Parameters.Add(Mapped.Parameter("?cli_senha", pwd));

        objDataDadapter = Mapped.adapter(objCommand);
        objDataDadapter.Fill(ds);

        objConnection.Close();
        objCommand.Dispose();
        objConnection.Dispose();
        return(ds);
    }