protected void BuscarIdButton_Click(object sender, EventArgs e) { if (BuscarIdTextBox.Text != "") { Ventas venta = new Ventas(); if (venta.Buscar(ConvertirValor(BuscarIdTextBox.Text))) { Limpiar(false); Session["Venta"] = venta; ControlDeBotones(2); MontoLabel.Text = venta.Monto.ToString(); foreach (VentasDetalle detalle in venta.DetalleLista) { GuardatLista(detalle); } DetalleGridView.DataSource = ObtenerLista(); DetalleGridView.DataBind(); } else { Mensaje("Id no encontrado"); } } }
protected void DetalleGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); Expression <Func <Articulos, bool> > filtro = p => true; RepositorioBase <Articulos> repositorio = new RepositorioBase <Articulos>(); var lista = repositorio.GetList(c => true); var productos = repositorio.Buscar(lista[index].ArticuloId); decimal Total = 0; decimal Total2 = Convert.ToInt32(TotalTextBox.Text); decimal ite = 0; decimal sub = 0; foreach (var item in lista) { Total = item.Precio * Convert.ToInt32(CantidadTextBox.Text); } Total2 = Total2 - Total; ite = Total2 * 18 / 100; sub = Total2 - ite; TotalTextBox.Text = Total2.ToString(); SubTotalTextBox.Text = sub.ToString(); ItbisTextBox.Text = ite.ToString(); ((List <CompraDetalle>)ViewState["CompraDetalle"]).RemoveAt(index); DetalleGridView.DataSource = ViewState["CompraDetalle"]; DetalleGridView.DataBind(); } }
private void ActualizarGrid() { Evaluacion evaluacion = (Evaluacion)ViewState[KeyViewState]; DetalleGridView.DataSource = evaluacion.DetalleEvaluacion; DetalleGridView.DataBind(); }
private void LlenarDataGrid() { List <PresupuestoDetalle> Lista = (List <PresupuestoDetalle>)Session["ListaRelaciones"]; DetalleGridView.DataSource = Lista; DetalleGridView.DataBind(); }
protected void EliminarButton_Click(object sender, EventArgs e) { //RepositorioBase<Rentas> repositorio = new RepositorioBase<Rentas>(); List <RentasDetalles> lista = (List <RentasDetalles>)ViewState["Detalle"]; Rentas renta = repositorioRenta.Buscar(Utils.ToInt(RentaIDTextBox.Text)); if (IsValid) { if (renta != null) { if (repositorioRenta.Eliminar(renta.RentaId)) { ViewState["Detalle"] = lista; DetalleGridView.DataSource = ViewState["Detalle"]; DetalleGridView.DataBind(); Quitar(); Limpiar(); Utils.MostraMensaje(this, "Eliminado", "Exito", "success"); } else { Utils.MostraMensaje(this, "No se pudo eliminar", "Error", "error"); } } else { Utils.MostraMensaje(this, "No existe", "Error", "error"); } } }
private void ActualizarGrid() { Estudiante estudiante = (Estudiante)ViewState[KeyViewState]; DetalleGridView.DataSource = estudiante.DetalleEstudiante; DetalleGridView.DataBind(); }
protected void EliminarButton_Click(object sender, EventArgs e) { GridViewRow grid = DetalleGridView.SelectedRow; List <AnalisisDetalle> lista = (List <AnalisisDetalle>)ViewState["Detalle"]; RepositorioBase <Analisis> repositorio = new RepositorioBase <Analisis>(); Analisis analisis = repositorio.Buscar(Utils.ToInt(idTextBox.Text)); if (IsValid) { if (analisis != null) { repositorio.Eliminar(analisis.AnalisisID); DetalleGridView.DataSource = ViewState["Detalle"]; DetalleGridView.DataBind(); Utils.ShowToastr(this.Page, "Eliminado con exito!!", "Eliminado", "success"); Limpiar(); } else { Utils.ShowToastr(this.Page, "Revisar todos los campo", "Error", "error"); Limpiar(); } } }
protected void BindGrid() { Analisis analisis = ViewState[KeyViewState].ToAnalisis(); DetalleGridView.DataSource = analisis.AnalisisDetalle; DetalleGridView.DataBind(); }
private void Bindgrid() { Pesadas pesadas = ViewStateToEntity(ViewState[KeyViewState]); DetalleGridView.DataSource = pesadas.Detalles; DetalleGridView.DataBind(); }
private void BindGrid() { Evaluaciones evaluaciones = (Evaluaciones)ViewState[KeyViewState]; DetalleGridView.DataSource = evaluaciones.DetalleEvaluaciones; DetalleGridView.DataBind(); }
private void BindGrid() { Pago Pagos = ViewState[KeyViewState].ToPago(); DetalleGridView.DataSource = Pagos.PagoDetalle; DetalleGridView.DataBind(); }
private void Limpiar() { idTextBox.Text = string.Empty; descripcionTextBox.Text = string.Empty; tipoDropDownList.SelectedIndex = 0; DetalleGridView.DataSource = null; DetalleGridView.DataBind(); }
protected void DetalleGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { Pago Pago = ViewState[KeyViewState].ToPago(); DetalleGridView.DataSource = Pago.PagoDetalle; DetalleGridView.PageIndex = e.NewPageIndex; DetalleGridView.DataBind(); }
protected void BindGrid() { if (ViewState["Evaluacion"] != null) { DetalleGridView.DataSource = ((Evaluacion)ViewState["Evaluacion"]).Detalle; DetalleGridView.DataBind(); } }
protected void DetalleGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { Analisis analisis = ViewState[KeyViewState].ToAnalisis(); DetalleGridView.DataSource = analisis.AnalisisDetalle; DetalleGridView.PageIndex = e.NewPageIndex; DetalleGridView.DataBind(); }
protected void BindGrid() { if (ViewState["Analisis"] != null) { DetalleGridView.DataSource = ((Analisis)ViewState["Analisis"]).Detalle; DetalleGridView.DataBind(); } }
protected void DetalleGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { Pesadas Pesada = ViewStateToEntity(ViewState[KeyViewState]); DetalleGridView.DataSource = Pesada.Detalles; DetalleGridView.PageIndex = e.NewPageIndex; DetalleGridView.DataBind(); }
private void Limpiar() { PagosIdTextBox.Text = "0"; FechaPagoTextBox.Text = DateTime.Now.ToString("yyyy-MM-dd"); AnalisisDropDown.SelectedIndex = 0; CantidadTextBox.Text = string.Empty; DetalleGridView.DataSource = null; DetalleGridView.DataBind(); }
private void BindGrid() { Calcular(); Evaluacion evaluaciones = ViewStateEvaluaciones(); evaluaciones.EvaluacionDetalle.ForEach(x => x.Categoria = new RepositorioBase <Categoria>().Buscar(x.CategoriaId).Descripcion); DetalleGridView.DataSource = evaluaciones.EvaluacionDetalle; DetalleGridView.DataBind(); }
private void ActualizarGrid() { Calcular(); Evaluaciones evaluacion = (Evaluaciones)ViewState[KeyViewState]; evaluacion.DetalleEvaluaciones.ForEach(x => x.Categoria = new RepositorioBase <Categorias>().Buscar(x.CategoriaID).Descripcion); DetalleGridView.DataSource = evaluacion.DetalleEvaluaciones; DetalleGridView.DataBind(); }
private void Limpiar() { EstudianteTexBox.Text = string.Empty; CategoriaTextBox.Text = "0"; ValorTextBox.Text = "0"; LogradoTextBox.Text = "0"; DetalleGridView.DataSource = null; DetalleGridView.DataBind(); }
private void RegAnalisisLimpiar() { AnalisisIdTextBox.Text = "0"; FechaTextBox.Text = DateTime.Now.ToString("yyyy-MM-dd"); // PacienteDropDown.SelectedIndex = 0; TiposAnalisisDropDown.SelectedIndex = 0; ResultadoTextBox.Text = string.Empty; DetalleGridView.DataSource = null; DetalleGridView.DataBind(); }
private void LlenarCampo(Analisis analisis) { tipoDropDownList.DataSource = repositorio.GetList(x => true); tipoDropDownList.DataValueField = "ID"; tipoDropDownList.DataTextField = "Descripcion"; tipoDropDownList.AppendDataBoundItems = true; tipoDropDownList.DataBind(); DetalleGridView.DataSource = analisis.detalle; DetalleGridView.DataBind(); }
protected void LinkButton_Click(object sender, EventArgs e) { var ventaAnt = FacturaRepositorio.Buscar(Utils.ToInt(VentaIdTextBox.Text)); bool paso = false; //if (Utils.ToInt(ProductoDropDownList.SelectedValue == DetalleGridView.ro)) if (DetalleGridView.Rows.Count > 0) { for (int i = 0; i < ((Ventas)ViewState["Detalle"]).Detalle.Count; i++) { if (((Ventas)ViewState["Detalle"]).Detalle[i].ProductoId == Utils.ToInt(ProductoDropDownList.SelectedValue.ToString())) { ((Ventas)ViewState["Detalle"]).Detalle[i].Cantidad = ((Ventas)ViewState["Detalle"]).Detalle[i].Cantidad + Utils.ToInt(CantidadTextBox.Text.ToString()); ((Ventas)ViewState["Detalle"]).Detalle[i].Importe = ((Ventas)ViewState["Detalle"]).Detalle[i].Cantidad * ((Ventas)ViewState["Detalle"]).Detalle[i].Precio; paso = true; break; } } if (!paso) { if (ventaAnt == null) { venta = (Ventas)ViewState["Detalle"]; venta.AgregarProductos(Utils.ToInt(ProductoDropDownList.SelectedValue), Utils.ToInt(CantidadTextBox.Text), Utils.ToInt(PrecioTextBox.Text), Utils.ToInt(CantidadTextBox.Text) * Utils.ToInt(PrecioTextBox.Text)); } else { Utils.ShowToastr(this, "Agregado", "Exito!!", "info"); ventaAnt = (Ventas)ViewState["Detalle"]; ventaAnt.AgregarProductos(Utils.ToInt(ProductoDropDownList.SelectedValue), Utils.ToInt(CantidadTextBox.Text), Utils.ToInt(PrecioTextBox.Text), Utils.ToInt(CantidadTextBox.Text) * Utils.ToInt(PrecioTextBox.Text)); } } } else { if (ventaAnt == null) { venta = (Ventas)ViewState["Detalle"]; venta.AgregarProductos(Utils.ToInt(ProductoDropDownList.SelectedValue), Utils.ToInt(CantidadTextBox.Text), Utils.ToInt(PrecioTextBox.Text), Utils.ToDouble(ImporteTextBox.Text)); } else { Utils.ShowToastr(this, "Agregado", "Exito!!", "info"); ventaAnt = (Ventas)ViewState["Detalle"]; ventaAnt.AgregarProductos(Utils.ToInt(ProductoDropDownList.SelectedValue), Utils.ToInt(CantidadTextBox.Text), Utils.ToInt(PrecioTextBox.Text), Utils.ToDouble(ImporteTextBox.Text)); } } ViewState["Venta"] = venta; DetalleGridView.DataSource = ((Ventas)ViewState["Detalle"]).Detalle; DetalleGridView.DataBind(); SubTotal(); }
public void Limpiar() { ClienteTextBox.Text = string.Empty; BuscarClienteTextBox.Text = string.Empty; TotalTextBox.Text = string.Empty; DetalleGridView.DataSource = null; DetalleGridView.DataBind(); BuscarIdTextBox.Text = string.Empty; ObtenerGridView(); LLenarGridview(); }
protected void agregarButton_Click(object sender, EventArgs e) { List <VentasDetalle> detalles = new List <VentasDetalle>(); if (IsValid) { RepositorioBase <Productos> repositorio = new RepositorioBase <Productos>(); Productos producto = new Productos(); int id = Utils.ToIntObjetos(ProductoDropDownList.SelectedValue); string descripcion = string.Empty;; producto = repositorio.Buscar(id); descripcion = producto.Descripcion; DateTime date = DateTime.Now.Date; int cantidad = Utils.ToInt(CantidadTextBox.Text); decimal precio = Utils.ToDecimal(PrecioTextBox.Text); decimal importe = Utils.ToDecimal(ImporteTextBox.Text); if (Producto()) { return; } Ventas venta = new Ventas(); if (DetalleGridView.Rows.Count != 0) { venta.Detalle = (List <VentasDetalle>)ViewState["Detalle"]; } if (Utils.ToIntObjetos(UsuarioDropDownList.SelectedValue) < 1) { Utils.ShowToastr(this, "No hay Usuarios guardado.", "Error", "error"); return; } if (Utils.ToIntObjetos(ProductoDropDownList.SelectedValue) < 1) { Utils.ShowToastr(this, "No hay Productos guardado.", "Error", "error"); return; } if (Utils.ToInt(IdTextBox.Text) == 0) { VentasDetalle detalle = new VentasDetalle(); venta.Detalle.Add(new VentasDetalle(0, detalle.VentaId, Utils.ToInt(ProductoDropDownList.SelectedValue), descripcion, cantidad, precio, importe)); } else { VentasDetalle detalle = new VentasDetalle(); venta.Detalle.Add(new VentasDetalle(0, Utils.ToInt(IdTextBox.Text), Utils.ToInt(ProductoDropDownList.SelectedValue), descripcion, cantidad, precio, importe)); } ViewState["Detalle"] = venta.Detalle; DetalleGridView.DataSource = ViewState["Detalle"]; DetalleGridView.DataBind(); Total(); } }
private void LlenaCampos(Prestamos prestamo) { PrestamoIdTextBox.Text = prestamo.PrestamoId.ToString(); FechaTextBox.Text = prestamo.Fecha.ToString("yyyy-MM-dd"); CuentaDropDownList.Text = prestamo.CuentaId.ToString(); CapitalTextBox.Text = prestamo.Capital.ToString(); InteresTextBox.Text = prestamo.TasaInteres.ToString(); TiempoTextBox.Text = prestamo.Tiempo.ToString(); DetalleGridView.DataSource = prestamo.Detalle; DetalleGridView.DataBind(); }
public void LlenarCampos(Ventas venta) { List <VentasDetalle> detalles = Detalle(Utils.ToInt(IdTextBox.Text)); ViewState["Detalle"] = detalles; UsuarioDropDownList.SelectedValue = venta.UsuarioId.ToString(); DetalleGridView.DataSource = ViewState["Detalle"]; DetalleGridView.DataBind(); totalTextBox.Text = venta.TotalAPagar.ToString(); EfectivoTextBox.Text = venta.Efectivo.ToString(); DevueltaTextBox.Text = venta.Devuelta.ToString(); }
private void Limpiar() { EvaluacionIdTextBox.Text = 0.ToString(); FechaTextBox.Text = DateTime.Now.ToString(); ValorTextBox.Text = 0.ToString(); LogradoTextBox.Text = 0.ToString(); TotalTextBox.Text = 0.ToString(); base.ViewState["Evaluaciones"] = new Evaluaciones(); DetalleGridView.DataSource = null; DetalleGridView.DataBind(); BindGrid(); }
private void LlenarCampos(Ventas venta) { Ventas ventass = (Ventas)ViewState["Detalle"]; VentaDetalle ventaDetalle = new VentaDetalle(); ConfiguracionesIdDropDownList1.SelectedValue = venta.ConfiguracionId.ToString(); ClienteDropDownList.SelectedValue = venta.ClienteId.ToString(); DetalleGridView.DataSource = venta.Detalle; DetalleGridView.DataBind(); TotalVentaTextBox1.Text = venta.TotalVenta.ToString(); }