public void LimpiaRecibo() { fechadeEmpeñoDateTimePicker.Value = DateTime.Now; fechaActualDateTimePicker.Value = DateTime.Now; cantidadNumericUpDown.Value = 0; descripcionTextBox.Clear(); montoTextBox.Clear(); HayErrores.Clear(); }
public void Limpiar() { cotizacionArticulosIdnumericUpDown.Value = 0; fechaDateTimePicker.Value = DateTime.Now; observacionesTextBox.Clear(); TotaltextBox.Clear(); cantidadnumericUpDown.Value = 0; importeTextBox.Clear(); detalledataGridView.DataSource = null; HayErrores.Clear(); }
public void Limpiar() { reciboIdNumericUpDown.Value = 0; fechadeEmpeñoDateTimePicker.Value = DateTime.Now; fechaActualDateTimePicker.Value = DateTime.Now; cantidadNumericUpDown.Value = 0; descripcionTextBox.Clear(); montoTextBox.Clear(); montoTotalTextBox.Clear(); DetalledataGridView.DataSource = null; HayErrores.Clear(); }
private void Guardarbutton_Click(object sender, EventArgs e) { if (Validar(2)) { MessageBox.Show("Debe Agregar Algun Producto al Grid", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { RegistrodeMantenimiento registrodeMantenimiento = LlenaClase(); bool Paso = false; //Determinar si es Guardar o Modificar if (mantenimientoIdNumericUpDown.Value == 0) { Paso = BLL.RegistrodeMantenimientoBLL.Guardar(registrodeMantenimiento); HayErrores.Clear(); } else { var V = BLL.RegistrodeMantenimientoBLL.Buscar(Convert.ToInt32(mantenimientoIdNumericUpDown.Value)); if (V != null) { Paso = BLL.RegistrodeMantenimientoBLL.Editar(registrodeMantenimiento); } HayErrores.Clear(); } //Informar el resultado if (Paso) { Limpiar(); MessageBox.Show("Guardado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void Guardarbutton_Click(object sender, EventArgs e) { CotizacionArticulos cotizacionArticulos = LlenaClase(); bool Paso = false; if (Validar()) { MessageBox.Show("Favor revisar todos los campos", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //Determinar si es Guardar o Modificar if (cotizacionArticulosIdnumericUpDown.Value == 0) { Paso = BLL.CotizacionArticulosBLL.Guardar(cotizacionArticulos); HayErrores.Clear(); } else { Paso = BLL.CotizacionArticulosBLL.Editar(cotizacionArticulos); HayErrores.Clear(); } //Esto es para en caso de que se elimine algun elemento del datagrid y se modifique que elimine el detalle //Informar el resultado if (Paso) { Limpiar(); MessageBox.Show("Guardado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Limpiar() { mantenimientoIdNumericUpDown.Value = 0; fechaDateTimePicker.Value = DateTime.Now; cantidadNumericUpDown.Value = 0; TotaltextBox.Clear(); importeTextBox.Clear(); subtotaltextBox.Text = 0.ToString(); TotaltextBox.Text = 0.ToString(); ItbistextBox.Text = 0.ToString(); DetalledataGridView.DataSource = null; itbis = 0; Total = 0; HayErrores.Clear(); }
private void Guardarbutton_Click(object sender, EventArgs e) { if (Validar(2)) { MessageBox.Show("Debe Agregar Algun Producto al Grid", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { foreach (var item in BLL.ActivodeNegocioBLL.GetList(x => x.ActivodeNegocioId == 1)) { if (item.Activo < Convert.ToDecimal(montoTotalTextBox.Text)) { MessageBox.Show("La Compraventa No dispone de Esa Cantidad de dinero ", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } Recibos recibos = LlenaClase(); bool Paso = false; //Determinar si es Guardar o Modificar if (reciboIdNumericUpDown.Value == 0) { Paso = ReciboBLL.Guardar(recibos); HayErrores.Clear(); } else { var V = ReciboBLL.Buscar(Convert.ToInt32(reciboIdNumericUpDown.Value)); if (V != null) { Paso = ReciboBLL.Editar(recibos); } HayErrores.Clear(); } if (MessageBox.Show("¿Desea Imprimir el Recibo?", "Salir", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) { List <Recibos> list = ReciboBLL.GetList(X => true); List <Recibos> nuevo = new List <Recibos>(); nuevo.Add(list.Last()); VentanaReciboReporte abrir = new VentanaReciboReporte(nuevo); abrir.Show(); } //Informar el resultado if (Paso) { MessageBox.Show("Guardado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("No se pudo guardar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void Agregarbutton_Click(object sender, EventArgs e) { if (Validar(5)) { MessageBox.Show(" Combobox Vacio", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(4)) { MessageBox.Show(" LLene las Casillas Correspondiente", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Validar(3)) { MessageBox.Show(" Digite un Monto", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { HayErrores.Clear(); List <ReciboDetalles> detalle = new List <ReciboDetalles>(); if (DetalledataGridView.DataSource != null) { detalle = (List <ReciboDetalles>)DetalledataGridView.DataSource; } ActivodeNegocio negocio = BLL.ActivodeNegocioBLL.Buscar(1); if (Convert.ToDecimal(montoTextBox.Text) > negocio.Activo) { HayErrores.SetError(montoTextBox, "Error"); MessageBox.Show("No Hay esa Cantidad de Dinero Disponiblle!!", "Validación!!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(montoTextBox.Text) && string.IsNullOrEmpty(cantidadNumericUpDown.Text)) { MessageBox.Show(" Llene cantidad y Monto", "Validacion", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { detalle.Add( new ReciboDetalles(iD: 0, reciboId: (int)Convert.ToInt32(reciboIdNumericUpDown.Value), articuloId: (int)articuloIdComboBox.SelectedValue, articulo: (string)BLL.ArticulosBLL.RetornarNombre(articuloIdComboBox.Text), descripcion: (string)descripcionTextBox.Text, cantidad: (int)Convert.ToInt32(cantidadNumericUpDown.Value), monto: (decimal)Convert.ToDecimal(montoTextBox.Text) )); //Cargar el detalle al Grid DetalledataGridView.DataSource = null; DetalledataGridView.DataSource = detalle; decimal monto = 0; foreach (var item in detalle) { monto += item.Monto; } montoTotalTextBox.Text = monto.ToString(); //Oculta las Columnas No deceada NoColumnas(); LimpiaRecibo(); } } }