Example #1
0
        protected void Alterar_Click(object sender, EventArgs e)
        {
            try
            {
                Class_Produto vend = new Class_Produto();
                vend.cb            = txtcb.Text;
                vend.cb            = txtcb.Text;
                vend.nomeprod      = txtnomeprod.Text;
                vend.valorvenda    = int.Parse(txtvalorvenda.Text);
                vend.qtdeprod      = int.Parse(txtqtdeprod.Text);
                vend.qtdeminprod   = int.Parse(txtqtdeminprod.Text);
                vend.datavalidade  = DateTime.Parse(txtvalorvenda.Text);
                vend.prazogarantia = txtprazogarantia.Text;
                vend.lote          = txtLote.Text;

                vend.alterar_dados();

                GDProduto.DataSource = vend.visualizar();
                GDProduto.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Example #2
0
        protected void GDProduto_RowEditing(object sender, GridViewEditEventArgs e)
        {
            Class_Produto vend = new Class_Produto();

            GDProduto.EditIndex  = -1;
            GDProduto.EditIndex  = e.NewEditIndex;
            GDProduto.DataSource = vend.visualizar();
            GDProduto.DataBind();
        }
Example #3
0
        protected void GDProduto_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Class_Produto vend = new Class_Produto();

            vend.cb = e.Values[0].ToString();
            vend.deletar();

            GDProduto.EditIndex  = -1;
            GDProduto.DataSource = vend.visualizar();
            GDProduto.DataBind();
        }
Example #4
0
 protected void Visualizar_Click(object sender, EventArgs e)
 {
     try
     {
         Class_Produto vend = new Class_Produto();
         GDProduto.DataSource = vend.visualizar();
         GDProduto.DataBind();
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Example #5
0
        protected void GDProduto_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Class_Produto vend = new Class_Produto();

            vend.cb            = e.NewValues[0].ToString();
            vend.nomeprod      = e.NewValues[1].ToString();
            vend.valorvenda    = int.Parse(e.NewValues[2].ToString());
            vend.qtdeprod      = int.Parse(e.NewValues[3].ToString());
            vend.qtdeminprod   = int.Parse(e.NewValues[4].ToString());
            vend.datavalidade  = DateTime.Parse(e.NewValues[5].ToString());
            vend.prazogarantia = e.NewValues[6].ToString();
            vend.lote          = e.NewValues[7].ToString();

            vend.alterar_dados();

            GDProduto.EditIndex  = -1;
            GDProduto.DataSource = vend.visualizar();
            GDProduto.DataBind();
        }