private void btnNew_Click(object sender, EventArgs e) { try { string Rpta = ""; if (txtIdProveedor.Text == string.Empty || txtImpuesto.Text == string.Empty || txtNumComprobante.Text == string.Empty || DtDetalle.Rows.Count == 0) { this.MensajeError("Falta de Ingresar"); ErrorIcono.SetError(txtIdProveedor, "Selecccione un Proveedor"); ErrorIcono.SetError(txtImpuesto, "Ingrese un Impuesto"); ErrorIcono.SetError(txtNumComprobante, "Ingrese un Numero de Comprobante"); ErrorIcono.SetError(dgvDetalle, "Deve tener por lo Menos un Articulo"); } else { //Convert.ToInt32(txtIdeDocumento.Text), Rpta = N_Ingreso.Insertar(Convert.ToInt32(cboComprobante.SelectedValue), "Ingreso", txtSerie.Text.Trim(), txtNumComprobante.Text.Trim(), Convert.ToInt32(txtIdProveedor.Text), Convert.ToDecimal(txtSubTotal.Text), Convert.ToDecimal(txtIVA.Text), Convert.ToDecimal(txtTotal.Text), Convert.ToInt32(cboBodega.SelectedValue), Variables.idUsuarios, 1, DtDetalle); if (Rpta.Equals("OK")) { this.MensajeOk("Se Registro Transaccion de Ingreso"); this.Limpiar(); this.Listar(); tabControl1.SelectedIndex = 0; } else { this.MensajeError(Rpta); } } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void Buscar() { try { dataGridView1.DataSource = N_Ingreso.Buscar(txtBuscar.Text); this.formato(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void Buscar() { try { dgvResumen.DataSource = N_Ingreso.ConsultarFechas(Convert.ToDateTime(ddesde.Value), Convert.ToDateTime(dhasta.Value)); this.formato(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void CargarDocumentos() { try { cboComprobante.DataSource = N_Ingreso.SeleccionarDocumento(); cboComprobante.ValueMember = "id"; cboComprobante.DisplayMember = "nombre"; } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void CargarBodegas() { try { cboBodega.DataSource = N_Ingreso.SeleccionarBodega(); cboBodega.ValueMember = "idebodega"; cboBodega.DisplayMember = "nombrebodega"; } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
public void Consultar() { string condicion = ""; if (cb_buscar.Text == "ID") { condicion = "ID_INGRESO =" + txt_buscar.Text + ""; } else if (cb_buscar.Text == "DESCRIPCION" || cb_buscar.Text == "") { condicion = "(DESCRIPCION LIKE'%" + txt_buscar.Text + "%')"; } dg.DataSource = N_Ingreso.Consultar_Datos(condicion); lbl_total.Text = "Total de Regist.: " + dg.Rows.Count.ToString(); }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { dgvMostarDetalle.DataSource = N_Ingreso.ListarDetalle(Convert.ToInt32(dataGridView1.CurrentRow.Cells["ID"].Value)); decimal Total, Subtotal; decimal Impuesto = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["Impuesto"].Value); Total = Convert.ToDecimal(dataGridView1.CurrentRow.Cells["Total"].Value); Subtotal = Total / Impuesto; txtSubTotalDetalle.Text = Subtotal.ToString("#0.00#"); txtTotalDetalle.Text = Total.ToString("#0.00#"); txtIVADetalle.Text = (Total - Subtotal).ToString("#0.00#"); panelDetalleDoc.Visible = true; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void Insertar_Actualizar() { try { if (Validar() == false) { return; } E_Ingreso obj = new E_Ingreso(); string mensaje = ""; obj._CREADO_POR = Funciones.Utilitario.Datos_Usuarios.USUARIO; obj._ESTADO = cb_estado.Text; obj._FECHA_CREADO = DateTime.Now; obj._DESCRIPCION = txt_descripcion.Text.Trim(); obj._TIPO = cb_tipo.Text; if (txt_id.Text.Equals("")) { N_Ingreso.Insertar_Datos(obj); mensaje = "Datos Insertados Con Exito"; } else { obj._ID_INGRESO = Convert.ToInt32(txt_id.Text); N_Ingreso.Actualizar_Datos(obj); mensaje = "Datos Actualizados Con Exito"; } Frm_Mant_Ingresos frm = this.Owner as Frm_Mant_Ingresos; if (frm != null) { frm.Consultar(); } this.Close(); Funciones.Utilitario.Mensaje_Informacion(mensaje); } catch (Exception ex) { Funciones.Utilitario.Mensaje_Error(ex.Message); } }
private void btnGuardar_Click(object sender, EventArgs e) { try { string Rpta = ""; if (txtIdProveedor.Text != string.Empty || txtSerie.Text != string.Empty || txtCorrelativo.Text != string.Empty || txtIva.Text != string.Empty) { if (MessageBox.Show("¿esta seguro de ralizar la operación?", "Ferreteria Emanuel", MessageBoxButtons.YesNo) == DialogResult.Yes) { ObjEntidad.Id_empleado = E_Datos_Login.Id_empleado; ObjEntidad.Id_proveedor = Convert.ToInt32(txtIdProveedor.Text); ObjEntidad.Fecha = dTPFecha.Value; ObjEntidad.Tipo_comprobante = cbTipoComprobante.Text; ObjEntidad.Serie = txtSerie.Text; ObjEntidad.Correlativo = txtCorrelativo.Text; ObjEntidad.Iva = Convert.ToDecimal(txtIva.Text); ObjEntidad.Estado = "EMITIDO"; Rpta = N_Ingreso.InsertarIngreso(ObjEntidad, DTDetalles); if (Rpta.Equals("OK")) { MensajeConfirmacion("Se guardó correctamente la compra"); } else { MensajeError(Rpta); } Close(); } } else { MensajeError("Seleccione el proveedor y cargar datos de Ingreso"); } } catch (Exception ex) { MensajeError("ERROR " + ex.Message + ex.StackTrace); } }
private void cmdDelete_Click(object sender, EventArgs e) { try { DialogResult Opcion; Opcion = MessageBox.Show("Esta Seguro de Anular Ingreso", "D Criollo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { int Codigo; String Rpta = ""; foreach (DataGridViewRow row in dataGridView1.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { Codigo = Convert.ToInt32(row.Cells[1].Value); Rpta = N_Ingreso.Anular(Codigo); if (Rpta.Equals("OK")) { this.MensajeOk("Registro Anulado: " + Convert.ToString(row.Cells[6].Value) + "-" + Convert.ToString(row.Cells[7].Value)); } else { this.MensajeError(Rpta); } } } } this.Listar(); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
//metodo llama al metodo mostrar registro de la clase N_Empleado NOOO FUNNNCIONA private void MostrarDetalle() { FrmIngreso Ingreso = new FrmIngreso(); Ingreso.DataDetalle.DataSource = N_Ingreso.MostrarDetalle(Convert.ToInt32(DataListado.CurrentRow.Cells[0].Value.ToString())); }
//metodo llama al metodo buscar registro de la clase N_Empleado private void BuscarRegistroFecha() { this.DataListado.DataSource = N_Ingreso.BuscarRegistroFecha(Convert.ToDateTime(this.dtFecha1.Value.ToString("dd/MM/yyyy")), Convert.ToDateTime(this.dtFecha2.Value.ToString("dd/MM/yyyy"))); }
//metodo llama al metodo mostrar registro de la clase N_Empleado private void MostrarRegistro() { this.DataListado.DataSource = N_Ingreso.MostrarRegistro(); this.DataListado.ClearSelection(); }