Example #1
0
        private void txtNit_DoubleClick(object sender, EventArgs e)
        {
            FrmSelTercero Frm = new FrmSelTercero();

            Frm.tipo = "Empleados";
            Frm.ShowDialog(this);
        }
Example #2
0
        private void lblBuscar_Click(object sender, EventArgs e)
        {
            FrmSelTercero Frm = new FrmSelTercero();

            Frm.tipo = "";
            Frm.ShowDialog(this);
        }
Example #3
0
        private void txtEmpresa_DoubleClick(object sender, EventArgs e)
        {
            texto = (TextBox)sender;
            FrmSelTercero Frm = new FrmSelTercero();

            Frm.tipo = "PROVEEDOR";
            Frm.ShowDialog(this);
        }
Example #4
0
        private void txtCodResp_DoubleClick(object sender, EventArgs e)
        {
            texto = (TextBox)sender;
            FrmSelTercero Frm = new FrmSelTercero();

            Frm.tipo = "Empleados";
            Frm.ShowDialog(this);
        }
Example #5
0
        private void txtNit_DoubleClick(object sender, EventArgs e)
        {
            busGrilla = false;
            textoSel  = (TextBox)sender;
            FrmSelTercero Frm = new FrmSelTercero();

            Frm.tipo = "PROVEEDOR";
            Frm.ShowDialog(this);
        }
Example #6
0
 private void  buscarNit(string nit)
 {
     if (string.IsNullOrWhiteSpace(nit))
     {
         FrmSelTercero frmST = new FrmSelTercero();
         frmST.tipo = "PROVEEDOR";
         frmST.ShowDialog(this);
     }
     else
     {
         tercero = bllTer.buscar(nit);
         if (tercero == null)
         {
             DialogResult result;
             result = MessageBox.Show("El Nit / Cedula " + nit + " del tercero no existe en los registros, ¿Desea Agregarlos? ",
                                      "Control de Información ", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (result == System.Windows.Forms.DialogResult.Yes)
             {
                 FrmTerceros frmT = new FrmTerceros();
                 frmT.ShowDialog();
             }
         }
     }
 }
Example #7
0
        private void dgvDatos_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            busGrilla = false;
            if (e.RowIndex >= 0)
            {
                switch (e.ColumnIndex)
                {
                case 0:
                    if (dgvDatos.Rows[e.RowIndex].Cells["dtDescripcion"].Value != null)
                    {
                        dgvDatos.Rows[e.RowIndex].Cells["dtDescripcion"].Value = dgvDatos.Rows[e.RowIndex].Cells["dtDescripcion"].Value.ToString().ToUpper();
                    }
                    break;

                case 1:
                    string sdebito = (string)dgvDatos.Rows[e.RowIndex].Cells["dtDebito"].Value ?? "0";
                    if (string.IsNullOrEmpty(sdebito) || sdebito == ",")
                    {
                        sdebito = "0";
                    }
                    dgvDatos.Rows[e.RowIndex].Cells["dtDebito"].Value = UtilSystem.fMoneda(Math.Round(Convert.ToDouble(sdebito), 2));
                    if (Convert.ToDouble(sdebito) > 0)
                    {
                        dgvDatos.Rows[e.RowIndex].Cells["dtCredito"].Value = "0,00";
                        SendKeys.Send("{TAB}");
                    }
                    break;

                case 2:
                    string scredito = (string)dgvDatos.Rows[e.RowIndex].Cells["dtCredito"].Value;
                    if (string.IsNullOrEmpty(scredito) || scredito == ",")
                    {
                        scredito = "0";
                    }
                    dgvDatos.Rows[e.RowIndex].Cells["dtCredito"].Value = UtilSystem.fMoneda(Math.Round(Convert.ToDouble(scredito), 2));
                    if (Convert.ToDouble(scredito) > 0)
                    {
                        dgvDatos.Rows[e.RowIndex].Cells["dtDebito"].Value = "0,00";
                    }
                    break;

                case 3:
                    busGrilla = true;
                    if (dgvDatos.Rows[e.RowIndex].Cells["dtCuenta"].Value != null)
                    {
                        buscarCuenta(dgvDatos.Rows[e.RowIndex].Cells["dtCuenta"].Value.ToString());
                    }
                    else
                    {
                        FrmSelCuentas frmSC = new FrmSelCuentas();
                        frmSC.ShowDialog(this);
                    }
                    break;

                case 4:
                    string sBase = (string)dgvDatos.Rows[e.RowIndex].Cells["dtBase"].Value;
                    if (string.IsNullOrEmpty(sBase) || sBase == ",")
                    {
                        sBase = "0";
                    }
                    dgvDatos.Rows[e.RowIndex].Cells["dtBase"].Value = UtilSystem.fMoneda(Math.Round(Convert.ToDouble(sBase), 2));
                    break;

                case 5:

                    string sDias = (string)dgvDatos.Rows[e.RowIndex].Cells["dtDvmto"].Value ?? "0";
                    if (string.IsNullOrEmpty(sDias))
                    {
                        sDias = "0";
                    }
                    int      dias  = Convert.ToInt16(sDias);
                    DateTime fecha = Convert.ToDateTime(txtDia.Text + txtFecha.Text);
                    dgvDatos.Rows[e.RowIndex].Cells["dtFecha"].Value = fecha.AddDays(dias).ToShortDateString();
                    MessageBox.Show(dgvDatos.Rows[e.RowIndex].Cells["dtFecha"].Value.ToString());
                    break;

                case 6:
                    try {
                        DateTime Fecha = DateTime.Parse(dgvDatos.Rows[e.RowIndex].Cells["dtFecha"].Value.ToString());
                    } catch (Exception) {
                        MessageBox.Show("Error al digitar la fecha de vencimiento, Verifique el formato (DD/MM/AAAA)", "SAE Control de Errores", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        dgvDatos.Rows[e.RowIndex].Cells["dtFecha"].Value = "00/00/0000";
                    }
                    break;

                case 7:
                    busGrilla = true;
                    if (dgvDatos.Rows[e.RowIndex].Cells["dtNit"].Value != null)
                    {
                        buscarNit(dgvDatos.Rows[e.RowIndex].Cells["dtNit"].Value.ToString());
                    }
                    else
                    {
                        FrmSelTercero frmT = new FrmSelTercero();
                        frmT.tipo = "PROVEEDOR";
                        frmT.ShowDialog(this);
                    }
                    break;

                case 8:
                    busGrilla = true;
                    if (dgvDatos.Rows[e.RowIndex].Cells["dtCentro"].Value != null)
                    {
                        buscarCCosto(dgvDatos.Rows[e.RowIndex].Cells["dtCentro"].Value.ToString());
                    }
                    else
                    {
                        FrmSelCentroCostos frmSCC = new FrmSelCentroCostos();
                        frmSCC.ShowDialog(this);
                    }
                    break;
                }
            }
            sacarCuenta();
        }