private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtCantidad.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Cantidad"); TxtCantidad.Focus(); return; } if (TxtPrecio.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Precio"); TxtPrecio.Focus(); return; } double c, p, subt, t, tp; c = Convert.ToDouble(TxtCantidad.Text); p = Convert.ToDouble(TxtPrecio.Text); if (c >= 3) { t = c * p; subt = (c * p) * 0.20; tp = t - subt; TxtSubtotal.Text = subt.ToString(); TxtTotalaPagar.Text = tp.ToString(); } else { t = c * p; subt = (c * p) * 0.20; tp = t - subt; TxtSubtotal.Text = subt.ToString(); TxtTotalaPagar.Text = tp.ToString(); } }
private void BtnCancelar_Click(object sender, EventArgs e) { TxtCantidad.Clear(); TxtPrecio.Clear(); TxtTotal.Clear(); TxtCantidad.Focus(); }
private void BtnLimpiar_Click(object sender, EventArgs e) { foreach (TextBox Txt in this.Controls.OfType <TextBox>()) { Txt.Clear(); TxtCantidad.Focus(); } }
private void TxtCantidad_TextChanged(object sender, EventArgs e) { if (TxtCantidad.Text.Trim().Length > 0) { POO.AlertNotNumber(TxtCantidad.Text.Trim()); TxtCantidad.Focus(); return; } }
private void btnProductos_Click(object sender, EventArgs e) { ConsultarProductos ConPro = new ConsultarProductos(); ConPro.ShowDialog(); txtCodigoPro.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); TxtDescripcion.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); TxtPrecio.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString(); TxtCantidad.Focus(); }
private bool ValidarValorVariables() { if (PrecioCompra == 0) { Soporte.MsgError("Ingrese el precio de compra del articulo"); TxtPrecioCompra.Focus(); return(false); } if (GananciaObtener == 0) { Soporte.MsgError("Ingrese el Saldo de Ganancia a Obtener"); TxtGananciaObtener.Focus(); return(false); } if (Cantidad == 0) { Soporte.MsgError("Capture la Cantidad de Artiulos que se ingresaran."); TxtCantidad.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 4) { if (MontoTotal == 0) { Soporte.MsgError("Ingrese el Monto Total del Comprobante."); TxtMontoTotal.Focus(); return(false); } if (TotalArticulos == 0) { Soporte.MsgError("Ingrese la Cantidad total de Articulos del Comprobante."); TxtTotalArticulos.Focus(); return(false); } if (NumeroComprobante == 0) { Soporte.MsgError("Ingrese el Numero del Comprobante."); TxtNumComprobante.Focus(); return(false); } } else { } return(true); }
private void LlenarDatosBusqueda() { DataGridViewRow row = DtgvListadoBusqueda.SelectedRows[0]; _idProductoActivo = Convert.ToInt64(row.Cells[0].Value); TxtCodigoBarras.Text = row.Cells[1].Value.ToString(); TxtNombre.Text = row.Cells[2].Value.ToString(); TxtPrecio.Text = row.Cells[3].Value.ToString(); TxtCantidad.Text = "1"; TxtCantidad.Focus(); PnlBusqueda.Visible = false; }
protected void BtnGuardar_Click(object sender, EventArgs e) { Solicitud sol = new Solicitud(); sol.Monto_solicitado = float.Parse(TxtCantidad.Text); sol.Id_concepto = int.Parse(DropIdConcepto.SelectedItem.Value.ToString()); sol.Id_empleado = int.Parse(DropIdEmpleado.SelectedItem.Value.ToString()); sol.Id_caja = int.Parse(DropIdCaja.SelectedItem.Value.ToString()); ms.crearSolicitud(sol); TxtCantidad.Text = ""; TxtCantidad.Focus(); }
private void BtnAgregar_Click(object sender, EventArgs e) { if (TxtCodigo.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Codigo Es Requerido."); TxtCodigo.Focus(); return; } if (TxtProducto.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Decripción Es Requerido."); TxtProducto.Focus(); return; } if (TxtCantidad.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Cantidad Es Requerido."); TxtCantidad.Focus(); return; } if (TxtPrecioU.Text.Trim().Length == 0) { POO.MsgWarning("El Campo Precio Unitario Es Requerido."); TxtPrecioU.Focus(); return; } DataGridViewRow fila = new DataGridViewRow(); fila.CreateCells(DgvFactura); fila.Cells[0].Value = TxtCodigo.Text.Trim(); fila.Cells[1].Value = TxtProducto.Text.Trim(); fila.Cells[2].Value = TxtCantidad.Text.Trim(); fila.Cells[3].Value = TxtPrecioU.Text.Trim(); double prec, cant; prec = Convert.ToDouble(TxtPrecioU.Text.Trim()); cant = Convert.ToDouble(TxtCantidad.Text.Trim()); fila.Cells[4].Value = POO.precU(prec, cant).ToString(); DgvFactura.Rows.Add(fila); TxtCodigo.Clear(); TxtProducto.Clear(); TxtCantidad.Clear(); TxtPrecioU.Clear(); TxtCodigo.Focus(); }
//Boton Productos private void BtProductos_Click(object sender, EventArgs e) { ConsultarProducto consultarProducto = new ConsultarProducto(); consultarProducto.ShowDialog(); if (consultarProducto.DialogResult == DialogResult.OK) { TxtCodigoProducto.Text = consultarProducto.dataGridView1.Rows[consultarProducto.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); TxtDescripcion.Text = consultarProducto.dataGridView1.Rows[consultarProducto.dataGridView1.CurrentRow.Index].Cells[1].Value.ToString(); TxtPrecio.Text = consultarProducto.dataGridView1.Rows[consultarProducto.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString(); TxtCantidad.Focus(); } }
private void BtnCalcular_Click(object sender, EventArgs e) { double cant, prec; cant = Convert.ToDouble(TxtCantidad.Text.Trim()); prec = Convert.ToDouble(TxtPrecio.Text.Trim()); tlp.totalp(cant, prec); foreach (TextBox txt in this.Controls.OfType <TextBox>()) { txt.Clear(); TxtCantidad.Focus(); } }
private void EditarProducto() { if (DtgvProductos.SelectedRows.Count != 1) { return; } _busquedaActiva = false; DataGridViewRow row = DtgvProductos.SelectedRows[0]; _idProductoActivo = Convert.ToInt64(row.Cells[0].Value); TxtCodigoBarras.Text = row.Cells[1].Value.ToString(); TxtNombre.Text = row.Cells[2].Value.ToString(); TxtPrecio.Text = row.Cells[3].Value.ToString(); TxtCantidad.Text = row.Cells[4].Value.ToString(); TxtCantidad.Focus(); EliminarProducto(); }
private void DtvFactura_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (DtvFactura.SelectedRows.Count > 0) { V_PrecioProducto = DtvFactura.CurrentRow.Cells["Precio"].Value.ToString(); TxtCantidad.Text = DtvFactura.CurrentRow.Cells["Cantidad"].Value.ToString(); V_IDDetalleVenta = DtvFactura.CurrentRow.Cells["ID_DetalleVenta"].Value.ToString(); V_CantidadProductoDetalle = DtvFactura.CurrentRow.Cells["Cantidad"].Value.ToString(); //V_IDProducto = DtvBusqueda.CurrentRow.Cells["ID_Producto"].Value.ToString(); V_IDProductoDetalle = DtvFactura.CurrentRow.Cells["ID_Producto"].Value.ToString(); V_IDProducto = DtvFactura.CurrentRow.Cells["ID_Producto"].Value.ToString(); MET_MostrarStock(); //TxtCantidad.Text = DtvFactura.CurrentRow.Cells["Cantidad"].Value.ToString(); TxtCantidad.Clear(); TxtCantidad.Focus(); LblErrorCantidad.Text = "INTRODUZCA LA CANTIDAD"; LblErrorCantidad.Visible = true; BtnConfirmarCantidad.Visible = true; } }
protected void BtnGrabarPedido_Click(object sender, EventArgs e) { if (Session.Count == 0) { LblMensaje.Text = "Debe Acceder Cuenta con su Usuario y Contraseña"; return; } if (TxtCantidad.Text.Trim() == "") { LblMensaje.Text = "Ingrese Cantidad"; TxtCantidad.Focus(); return; } if (TxtPrecio.Text.Trim() == "") { LblMensaje.Text = "Ingrese Precio"; TxtPrecio.Focus(); return; } GrabarCabecera(); try { Ent.Idpedido = int.Parse(0 + TxtIdPedido.Text); Ent.Iditem = int.Parse(DDLItem.SelectedValue); Ent.Cantidad = Double.Parse(0 + TxtCantidad.Text); Ent.Precio = Double.Parse(0 + TxtPrecio.Text); Ent.Importe = Double.Parse(0 + TxtCantidad.Text) * Double.Parse(0 + TxtPrecio.Text); int filas; filas = NegPedidos.GrabarPedidoDetalle(Ent); if (filas > 0) { RellenarPedidoDetalle(); } } catch (Exception ex) { LblMensaje.Text = ex.Message; } }
private void TxtArticulo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (TxtArticulo.Text != "") { string[] codigo = TxtArticulo.Text.Split('-'); if (codigo.Length > 1) { string Cod = (codigo[0].Length > codigo[1].Length) ? codigo[1] : codigo[0]; codigoProducto = Cod; TxtCantidad.Text = "1"; TxtCantidad.Focus(); TxtCantidad.SelectAll(); } else { MessageBox.Show("Seleccionar un producto", "", MessageBoxButtons.OK, MessageBoxIcon.None); } } } }
private void BtnAccion_Click(object sender, EventArgs e) { bool isSelected = this.ChkAccion.Checked; ContactoModel filter = new ContactoModel(); filter.Nombre = TxtNombre.Text; if (isSelected) { if (string.IsNullOrWhiteSpace(TxtNombre.Text)) { MessageBox.Show("Debe un Nombre"); TxtNombre.Focus(); return; } if (string.IsNullOrWhiteSpace(TxtCantidad.Text)) { MessageBox.Show("Debe ingresar la cantidad de datos que desea enviar"); TxtCantidad.Focus(); return; } bool resultParse = Int32.TryParse(TxtCantidad.Text, out int CatidadCrear); if (!resultParse) { MessageBox.Show("Debe ingresar un datos numerico"); TxtCantidad.Focus(); return; } filter.Cantidad = CatidadCrear; CrearDatos(filter); } else { BuscarDatos(filter); } }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtCantidad.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Cantidad"); TxtCantidad.Focus(); return; } double c, tp; c = Convert.ToDouble(TxtCantidad.Text); if (c >= 10) { tp = c * 80; TxtTotalaPagar.Text = tp.ToString(); } else { tp = c * 100; TxtTotalaPagar.Text = tp.ToString(); } }
private void BtnCalcular_Click(object sender, EventArgs e) { if (TxtCantidad.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Cantidad"); TxtCantidad.Focus(); return; } if (TxtPrecio.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Precio"); TxtPrecio.Focus(); return; } double c, p, t; c = Convert.ToDouble(TxtCantidad.Text); p = Convert.ToDouble(TxtPrecio.Text); t = c * p; TxtTotal.Text = t.ToString(); }
private async void PicProducto_SelectedIndexChanged(object sender, EventArgs e) { if (ClienteEncontrado == true) { if (PicProducto.SelectedIndex > -1) { int indice = PicProducto.SelectedIndex; string codigoProducto = Codigo[PicProducto.SelectedIndex].ToString(); string respuesta = await AgregarProductoLista(codigoProducto, TxtIdentificacion.Text); TxtCantidad.Focus(); TxtCantidad.Text = "1"; if (respuesta != "") { await DisplayAlert("Fallo!", "Lo sentimos conexión fallida." + "\r\n" + "Vuelva a intentarlo ", "OK"); } } } else { var msm = DisplayAlert("Fallo!", "No hay ningun cliente", "OK"); } }
private bool ValidarTextBox() { if (CmbComprobante.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un comprobante de la compra del Articulo"); CmbComprobante.Focus(); return(false); } if (Convert.ToInt32(CmbEmpresa.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione una Empres"); CmbEmpresa.Focus(); return(false); } if (Convert.ToInt32(CmbSucursal.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione una Sucursal"); CmbSucursal.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione un Tipo Entrada"); CmbTipEntradas.Focus(); return(false); } if (CmbProveedores.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un Proveedor del comprobante."); CmbProveedores.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCodigo.Text)) { Soporte.MsgInformacion("Ingrese Codigo del Articulo para poder agregar a la Lista"); TxtCodigo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtDescripcion.Text)) { Soporte.MsgInformacion("Busque el Articulo ya que faltan datos para Agregar a la Lista."); TxtCodigo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidad.Text) && TxtCantidad.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad del articulo a Ingresar"); TxtCantidad.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtCantidad.Text)) { Soporte.MsgInformacion("El formato de la Cantidad no es Valido."); TxtCantidad.Focus(); return(false); } if (string.IsNullOrEmpty(TxtPrecioCompra.Text) && TxtPrecioCompra.Text != "0") { Soporte.MsgInformacion("Ingrese Precio del articulo"); TxtPrecioCompra.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtPrecioCompra.Text)) { Soporte.MsgInformacion("El formato de Precio de Compra no es Valido."); TxtPrecioCompra.Focus(); return(false); } if (string.IsNullOrEmpty(TxtGananciaObtener.Text) && TxtGananciaObtener.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad de la Ganancia a Obtener"); TxtGananciaObtener.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtGananciaObtener.Text)) { Soporte.MsgInformacion("El formato de Ganancia a Obtener no es Valido."); TxtGananciaObtener.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 4) { if (string.IsNullOrEmpty(TxtNumComprobante.Text) && TxtNumComprobante.MaxLength < 2) { Soporte.MsgInformacion("El numero de comprobante no tiene el Formato correcto, revise."); TxtNumComprobante.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTotalArticulos.Text) && TxtTotalArticulos.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad Total del Comprobante"); TxtTotalArticulos.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtTotalArticulos.Text)) { Soporte.MsgInformacion("El formato de Total Articulos no es Valido."); TxtTotalArticulos.Focus(); return(false); } if (string.IsNullOrEmpty(TxtMontoTotal.Text) && TxtMontoTotal.Text != "0") { Soporte.MsgInformacion("Ingrese el Monto Total del Comprobante"); TxtMontoTotal.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtMontoTotal.Text)) { Soporte.MsgInformacion("El formato del Monto Total no es Valido."); TxtMontoTotal.Focus(); return(false); } if (string.IsNullOrEmpty(TxtIvaTotal.Text) && TxtIvaTotal.Text != "0") { Soporte.MsgInformacion("Ingrese el Monto Total del Iva"); TxtIvaTotal.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtIvaTotal.Text)) { Soporte.MsgInformacion("El formato del Iva Total no es Valido."); TxtIvaTotal.Focus(); return(false); } } else { } return(true); }
protected void lbtnAgregarDetalle_Click(object sender, EventArgs e) { lbtnRegistrarDevolucion.Visible = true; bool res = true; foreach (GridViewRow row in GVDetalles.Rows) { if (Convert.ToString(row.Cells[1].Text) == Convert.ToString(DlProductos.SelectedItem.Text)) { Respuesta.Visible = true; Respuesta.Text = "No puede agregar un detalle con el mismo codigo, se recomienda modificar el existente"; TxtCantidad.Text = ""; DlNombre_Prod.Items.Clear(); DlProductos.Items.Clear(); DlCategorias.Items.Clear(); Productos(); Cargar_Combos(); res = false; } } if (DlProductos.SelectedItem.Text == "Seleccione") { if (TxtCantidad.Text == "") { Respuesta.Visible = true; Respuesta.Text = "Por favor seleccione el producto, e ingrese la cantida"; DlProductos.Focus(); res = false; } else { Respuesta.Visible = true; Respuesta.Text = "Por favor seleccione el producto"; DlProductos.Focus(); res = false; } } if (DlProductos.SelectedItem.Text != "Seleccione") { if (TxtCantidad.Text == "") { Respuesta.Visible = true; Respuesta.Text = "Por favor ingrese cantidad"; TxtCantidad.Focus(); res = false; } } if (res) { Ldet.Eliminar_Detalles(DlProductos.SelectedItem.Text); Ldet.Registrar_detalles(DlProductos.SelectedItem.Text, Convert.ToInt32(TxtCantidad.Text), 0); GVDetalles.DataSource = Ldet.Consultar_Detalles(); GVDetalles.DataBind(); TxtCantidad.Text = ""; DlNombre_Prod.Items.Clear(); DlProductos.Items.Clear(); DlCategorias.Items.Clear(); Productos(); Cargar_Combos(); lbtnQuitarDetalle.Enabled = false; } }
private void BtnAgregar_Click(object sender, EventArgs e) { if (TxtCodProducto.Text != "P" && ValidarCantidad() && TxtStock.Text != "0") { if (CboSeries.Items.Count > 0) { if (CboSeries.SelectedIndex != -1) { double AuxSubtotal = int.Parse(TxtCantidad.Text) * double.Parse(TxtPrecio.Text); DgvDetalleVentas.Rows.Add(TxtCodProducto.Text, TxtCantidad.Text, TxtProducto.Text, TxtMarca.Text, TxtModelo.Text, CboSeries.Text, TxtPrecio.Text, AuxSubtotal); CalcularTotales(); EliminarSerie(TxtCodProducto.Text, CboSeries.Text); ActualizarStock(TxtCodProducto.Text, int.Parse(TxtCantidad.Text), false); } else { MessageBox.Show("Debe seleccionar una serie"); } } else { int Fila = BuscarCodigoGrid(TxtCodProducto.Text); if (Fila == -1) { double AuxSubtotal = int.Parse(TxtCantidad.Text) * double.Parse(TxtPrecio.Text); DgvDetalleVentas.Rows.Add(TxtCodProducto.Text, TxtCantidad.Text, TxtProducto.Text, TxtMarca.Text, TxtModelo.Text, CboSeries.Text, TxtPrecio.Text, AuxSubtotal); CalcularTotales(); ActualizarStock(TxtCodProducto.Text, int.Parse(TxtCantidad.Text), false); } else { int NuevaCantidad = int.Parse(DgvDetalleVentas.Rows[Fila].Cells[1].Value.ToString()) + int.Parse(TxtCantidad.Text); DgvDetalleVentas.Rows[Fila].Cells[1].Value = NuevaCantidad.ToString(); double AuxSubtotal = int.Parse(DgvDetalleVentas.Rows[Fila].Cells[7].Value.ToString()) * double.Parse(TxtPrecio.Text); DgvDetalleVentas.Rows[Fila].Cells[7].Value = AuxSubtotal.ToString(); DgvDetalleVentas.Rows[Fila].Cells[5].Value = " "; CalcularTotales(); ActualizarStock(TxtCodProducto.Text, int.Parse(TxtCantidad.Text), false); } } TxtCodProducto.Enabled = true; LimpiarTxtsProducto(); TxtCodProducto.Text = "P"; } else { if (TxtCodProducto.Text == "P") { MessageBox.Show("Ningun producto a sido seleccionado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (!ValidarCantidad()) { TxtCantidad.Focus(); TxtCantidad.SelectAll(); MessageBox.Show("Debe ingresar una cantidad menor o igual al stock del producto", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }