//Método BuscarFechas private void BuscarFechas() { this.dataListado.DataSource = NIngresos.BuscarFechas(this.dtFecha1.Value.ToString("dd/MM/yyyy"), this.dtFecha2.Value.ToString("dd/MM/yyyy")); this.OcultarColumnas(); lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); }
private void btnGuardar_Click(object sender, EventArgs e) { try { string rpta = ""; if (this.ArticulocomboBox.Text == string.Empty || this.txtSerie.Text == string.Empty || this.txtCorrelativo.Text == string.Empty || this.txtIgv.Text == string.Empty) { MensajeError("Falta ingresar algunos datos, serán remarcados"); errorIcono.SetError(txtSerie, "Ingrese un Valor"); errorIcono.SetError(txtCorrelativo, "Ingrese un Valor"); errorIcono.SetError(txtIgv, "Ingrese un Valor"); } else { if (this.IsNuevo) { rpta = NIngresos.Insertar(Convert.ToInt32(Idtrabajador), Convert.ToInt32(this.ProveedorcomboBox.SelectedValue), dtFecha.Value, cbTipo_Comprobante.Text, txtSerie.Text, txtCorrelativo.Text, Convert.ToDecimal(txtIgv.Text), "EMITIDO", dtDetalle); } if (rpta.Equals("OK")) { if (this.IsNuevo) { this.MensajeOk("Se Insertó de forma correcta el registro"); } } else { this.MensajeError(rpta); } this.IsNuevo = false; this.Botones(); this.Limpiar(); this.limpiarDetalle(); this.Mostrar(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void btnEliminar_Click(object sender, EventArgs e) { try { DialogResult Opcion; Opcion = MessageBox.Show("Realmente Desea Anular los Registros", "Sistema de Ventas", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (Opcion == DialogResult.OK) { string Codigo; string Rpta = ""; foreach (DataGridViewRow row in dataListado.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { Codigo = Convert.ToString(row.Cells[1].Value); Rpta = NIngresos.Anular(Convert.ToInt32(Codigo)); if (Rpta.Equals("OK")) { this.MensajeOk("Se Anuló Correctamente el Ingreso"); } else { this.MensajeError(Rpta); } } } this.Mostrar(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void MostrarDetalle() { this.dataListadoDetalle.DataSource = NIngresos.MostrarDetalle(this.txtIdingreso.Text); }
//Método Mostrar private void Mostrar() { this.dataListado.DataSource = NIngresos.Mostrar(); this.OcultarColumnas(); lblTotal.Text = "Total de Registros: " + Convert.ToString(dataListado.Rows.Count); }