private void btnElegirProducto_Click(object sender, EventArgs e) { try { Sucursal Origen = this.ObtenerSucursalSeleccionada(this.cmbSucursalOrigen); if (!string.IsNullOrEmpty(Origen.IDSucursal)) { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(14); ElegirProducto.Datos.IDSucursal = Origen.IDSucursal; ElegirProducto.Location = this.txtProducto.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { this.ProductoSeleccionado = ElegirProducto.Datos; this.txtProducto.Text = this.ProductoSeleccionado.NombreProducto; this.txtCantidad.Focus(); } } else { MessageBox.Show("Debe seleccionar la sucursal de origen.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmInventarioTransferencia ~ btnElegirProducto_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAgregarProveedor_Click(object sender, EventArgs e) { try { frmSeleccionarProducto ElegirServicio = new frmSeleccionarProducto(2); ElegirServicio.Location = this.btnAgregarServicio.PointToScreen(new Point()); ElegirServicio.Location = new Point(ElegirServicio.Location.X - 1, ElegirServicio.Location.Y - 2); ElegirServicio.ShowDialog(); ElegirServicio.Dispose(); if (ElegirServicio.DialogResult == DialogResult.OK) { Producto _Datos = ElegirServicio.Datos; Servicio _DatosServicio = new Servicio { IDServicio = _Datos.IDProducto, NombreServicio = _Datos.NombreProducto }; if (AgregarServicioLista(_DatosServicio)) { this.LlenarGridServicios(); } else { MessageBox.Show("El servicio ya está en la lista.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevaPromocion ~ btnbEliminarProveedor_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnElegirProducto_Click(object sender, EventArgs e) { try { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(6); ElegirProducto.Location = this.txtProducto.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { Producto Aux = ElegirProducto.Datos; Actual = Aux; this.txtProducto.Text = Aux.NombreProducto; this.btnGuardar.Focus(); } else { this.Actual = new Producto(); this.txtProducto.Text = string.Empty; } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevoPedidoProducto ~ btnElegirProducto_Click"); } }
private void btnElegirServicio_Click(object sender, EventArgs e) { try { frmSeleccionarProducto ElegirServicio = new frmSeleccionarProducto(2); ElegirServicio.Location = this.txtServicio.PointToScreen(new Point()); ElegirServicio.Location = new Point(ElegirServicio.Location.X - 1, ElegirServicio.Location.Y - 2); ElegirServicio.ShowDialog(); ElegirServicio.Dispose(); if (ElegirServicio.DialogResult == DialogResult.OK) { Producto Aux = ElegirServicio.Datos; this._ServicioElegido = new Servicio { IDServicio = Aux.IDProducto, NombreServicio = Aux.NombreProducto, TiempoMinutos = Aux.TiempoMinutos }; this.btnElegirCliente.Focus(); } else { this._ServicioElegido = new Servicio { IDServicio = string.Empty, NombreServicio = string.Empty, TiempoMinutos = 0 }; } this.txtServicio.Text = this._ServicioElegido.NombreServicio; this.txtTiempoServicio.Text = this._ServicioElegido.TiempoMinutos.ToString(); } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmElegirServicioCita ~ btnElegirServicio_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnElegirProducto_Click(object sender, EventArgs e) { try { Comision Aux = this.ObtenerTipoComisionSeleccionada(); if (Aux.IDTipoComision != 0) { int TipoForm = 0; switch (Aux.IDTipoComision) { case 1: case 4: TipoForm = 10; //Productos break; case 2: case 5: TipoForm = 2; //Productos break; } if (TipoForm > 0) { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(TipoForm); ElegirProducto.Location = this.txtProducto.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { this.DatosProducto = ElegirProducto.Datos; this.txtProducto.Text = this.DatosProducto.NombreProducto; } } } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevaReglaComision ~ btnElegirProducto_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnElegirProdServN_Click(object sender, EventArgs e) { try { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(16); ElegirProducto.Location = this.txtMxNProductoN.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { this.ProductoN = ElegirProducto.Datos; this.txtMxNProductoN.Text = this.ProductoN.NombreProducto; this.txtCantidadGratisMxN.Focus(); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevoVale ~ btnElegirProdServN_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnElegirProducto_Click(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(this.IDProveedor)) { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(4); ElegirProducto.Datos.IDProveedor = this.IDProveedor; ElegirProducto.Location = this.txtProducto.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { Producto Aux = ElegirProducto.Datos; Aux.Conexion = Comun.Conexion; this.txtProducto.Text = Aux.NombreProducto; this.txtClave.Text = Aux.Clave; this.txtUltimoCosto.Text = string.Format("{0:c}", Aux.UltimoCosto); this.txtUnidadMedida.Text = Aux.UnidadMedidaDesc; this.txtPrecio.Text = string.Format("{0:c}", 0); this.txtPrecioUSD.Text = string.Format("{0:c}", 0); this.txtIva.Text = string.Format("{0:c}", 0); this.txtCantidad.Text = "1"; this.Actual = Aux; this.txtCantidad.Focus(); } } else { MessageBox.Show("Debe elegir un proveedor.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevaCompra ~ btnElegirProducto_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnElegirProducto_Click(object sender, EventArgs e) { try { frmSeleccionarProducto ElegirProducto = new frmSeleccionarProducto(16); ElegirProducto.Location = this.txtProducto.PointToScreen(new Point()); ElegirProducto.Location = new Point(ElegirProducto.Location.X - 1, ElegirProducto.Location.Y - 2); ElegirProducto.ShowDialog(); ElegirProducto.Dispose(); if (ElegirProducto.DialogResult == DialogResult.OK) { if (!this.ExisteProductoEnLista(ElegirProducto.Datos.IDProducto)) { this.ListaProductos.Add(ElegirProducto.Datos); this.CargarGridProductos(); } } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmNuevoVale ~ btnElegirProdServNXN_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }