Example #1
0
        //Buscar por fechas columnas en DATAGRID
        private void BuscarFechas()
        {
            string textobuscar  = dtpFechaInicial.Value.ToString("yyyy-MM-dd");
            string textobuscar2 = dtpFechaFinal.Value.ToString("yyyy-MM-dd");

            //MessageBox.Show(textobuscar + "final: " + textobuscar2);
            //codigo buscar
            this.dgvPagos.DataSource = NPago_planilla.BuscarFechas(textobuscar, textobuscar2);
            this.OcultarColumnas();
            this.lblNumElementos.Text = "Elementos: " + Convert.ToString(this.dgvPagos.Rows.Count);
        }
Example #2
0
        private void btnAnular_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult Opcion;
                Opcion = MessageBox.Show("¿Realmente desea Anular los registros?", "Sistema POS", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Opcion == DialogResult.Yes)
                {
                    string Id;
                    string Rpta = "";

                    foreach (DataGridViewRow row in dgvPagos.Rows)
                    {
                        if (Convert.ToBoolean(row.Cells[0].Value))
                        {
                            Id   = Convert.ToString(row.Cells[1].Value);
                            Rpta = NPago_planilla.Anular(Convert.ToInt32(Id));

                            if (Rpta.Equals("OK"))
                            {
                                this.MensajeOK("Se Anuló correctamente el Ingreso.");
                            }
                            else
                            {
                                this.MensajeError(Rpta);
                            }
                        }
                    }
                    this.MostrarDatos();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Example #3
0
        //guardar datos
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            //insertar datos
            try
            {
                string rpta = "";
                this.mostrarCalculos();
                if (this.txtIdempleado.Text == string.Empty ||
                    this.txtSubtotal.Value == 0 ||
                    this.txtSubtotalNeto.Value == 0 ||
                    this.txtTotalPagar.Value == 0 ||
                    this.txtConceptoDe.Text == string.Empty ||
                    this.txtNumComprobante.Text == string.Empty ||
                    this.txtDescripcion.Text == string.Empty)
                {
                    MensajeError("Falta ingresar algunos datos, serán remarcados.");
                    errorIcono.SetError(this.txtIdempleado, "Seleccione un empleado en el combo.");
                    errorIcono.SetError(this.txtSubtotal, "Ingrese un valor.");
                    errorIcono.SetError(this.txtSubtotalNeto, "Ingrese un valor.");
                    errorIcono.SetError(this.txtTotalPagar, "Ingrese un valor.");
                    errorIcono.SetError(this.txtConceptoDe, "Ingrese un valor.");
                    errorIcono.SetError(this.txtNumComprobante, "Ingrese un valor.");
                    errorIcono.SetError(this.txtDescripcion, "Ingrese un valor.");
                }
                else
                {
                    if (this.EsNuevo)
                    {
                        rpta = NPago_planilla.Insertar(
                            this.dtpFechaPago.Value,
                            this.txtConceptoDe.Text.Trim().ToUpper(),
                            this.cmbTipoPago.Text,
                            this.txtNumComprobante.Text,
                            this.txtDescripcion.Text.Trim().ToUpper(),
                            this.cmbTipoImporte.Text,
                            Convert.ToDecimal(txtSubtotal.Value),
                            Convert.ToDecimal(txtSeguroSocial.Value),
                            Convert.ToDecimal(txtSubtotalNeto.Value),
                            Convert.ToDecimal(txtISR.Value),
                            Convert.ToDecimal(txtTotalPagar.Value),
                            "EMITIDO",
                            Convert.ToInt32(txtIdempleado.Text)
                            );
                    }

                    if (rpta.Equals("OK"))
                    {
                        if (this.EsNuevo)
                        {
                            this.MensajeOK("Se insertó de forma correcta el Ingreso.");
                        }
                    }
                    else
                    {
                        this.MensajeError(rpta);
                    }

                    //preparamos para nuevos datos
                    this.EsNuevo = false;
                    //this.EsEditar = false;
                    this.Botones();
                    this.Limpiar();
                    this.MostrarDatos();
                    this.errorIcono.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Example #4
0
 //MostrarDatos columnas en DATAGRID
 private void MostrarDatos() //en GRIDVIEW
 {
     this.dgvPagos.DataSource = NPago_planilla.Mostrar();
     this.OcultarColumnas();
     this.lblNumElementos.Text = "Elementos: " + Convert.ToString(this.dgvPagos.Rows.Count);
 }