protected void Limpiar() { FechaTextBox.Text = ""; IdTextBox.Text = ""; MontoTextBox.Text = ""; cantTextBox.Text = ""; ArtGridView.DataSource = null; ArtGridView.DataBind(); }
protected void AddButton_Click(object sender, EventArgs e) { Articulos art = new Articulos(); DataTable dt = (DataTable)ViewState["Detalle"]; art.Buscar(Convert.ToInt32(ArticulosDropDownList.SelectedValue)); aux = (float)ViewState["Monto"]; dt.Rows.Add(art.ArticuloId, art.Descripcion, cantTextBox.Text, art.Precio); ViewState["Detalle"] = dt; ArtGridView.DataSource = (DataTable)ViewState["Detalle"]; ArtGridView.DataBind(); aux += art.Precio * Convert.ToInt32(cantTextBox.Text); ViewState["Monto"] = aux; MontoTextBox.Text = ViewState["Monto"].ToString(); cantTextBox.Text = ""; }
protected void LlenaCampos(Ventas v) { VentasDetalle vd = new VentasDetalle(); Articulos art = new Articulos(); IdTextBox.Text = v.VentaId.ToString(); FechaTextBox.Text = v.Fecha; MontoTextBox.Text = v.Monto.ToString(); foreach (var a in v.Detalle) { art.Buscar(a.ArticuloId); DataTable det = (DataTable)ViewState["Detalle"]; det.Rows.Add(a.ArticuloId, art.Descripcion, a.Cantidad, a.Precio); ViewState["Detalle"] = det; ArtGridView.DataSource = (DataTable)ViewState["Detalle"]; ArtGridView.DataBind(); } }