示例#1
0
 protected void btnCadastro_Click(object sender, EventArgs e)
 {
     xx = new ClasseConexao();
     ds = new DataSet();
     ds = xx.executa_sql("insert into tblCliente values( '" + txtNome.Text + "', '" + txtSobrenome.Text + "', " + txtCPF.Text + ", " + txtCEP.Text + ", '" + txtCidade.Text + "', '" + txtEndereco.Text + "', getdate(), '" + txtNasc.Text + "', '" + txtEmail.Text + "', '" + txtPass.Text + "');");
     Response.Redirect("index.aspx");
 }
示例#2
0
 public List <List <String> > CarregaDados(String sql, bool colsFirst)
 {
     try
     {
         ds = new DataSet();
         cs = new ClasseConexao();
         ds = cs.executa_sql(sql);
         return(DataTableToMatrix(ds.Tables[0], colsFirst));
     }
     catch
     {
         return(new List <List <string> >());
     }
 }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             xx = new ClasseConexao();
             ds = new DataSet();
             ds = xx.executa_sql("select * from tblProduto where id_prod < 7");
             dlProdutos.DataSource = ds.Tables[0];
             dlProdutos.DataBind();
         }
         catch (Exception) { }
     }
 }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ClasseConexao xx = new ClasseConexao();
            DataSet       ds = new DataSet();

            if (!IsPostBack)
            {
                try
                {
                    xx = new ClasseConexao();
                    ds = new DataSet();
                    ds = xx.executa_sql("select * from tblProduto");
                    dlProdutos.DataSource = ds.Tables[0];
                    dlProdutos.DataBind();
                }
                catch (Exception) { }
                finally
                {
                    limpamenos(0);
                }
            }
        }
示例#5
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            String v1 = txtUser.Text;
            String v2 = txtPass.Text;

            xx = new ClasseConexao();
            ds = new DataSet();
            ds = xx.executa_sql("select * from tblCliente where email = '" + v1 + "' and senha = '" + v2 + "'");
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Response.Redirect("Index.aspx");
                    Session["idCliente"] = v1;
                    Session["logado"]    = "1";
                }
                else
                {
                    Session["logado"] = 0;
                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('Usúario e/ou Senha Incorretos');", true);
                }
            }
        }