Exemple #1
0
 private void _Dg_Comprobante_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         if (e.ColumnIndex == 1 & !_Dg_Comprobante.Rows[e.RowIndex].Cells[0].ReadOnly)
         {
             Cursor = Cursors.WaitCursor;
             Frm_VstCuentas _Frm = new Frm_VstCuentas();
             Cursor = Cursors.Default;
             _Frm.ShowDialog();
             if (_Frm._Str_FrmNodeSelec.Trim().Length > 0)
             {
                 if (_Mtd_CuentaDetalle(_Frm._Str_FrmNodeSelec.Trim()))
                 {
                     if (!_Mtd_ValidarCuenta(_Frm._Str_FrmNodeSelec.Trim(), e.RowIndex))
                     {
                         _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = _Frm._Str_FrmNodeSelec.Trim(); _Dg_Comprobante.Rows[e.RowIndex].Cells[2].Value = _Dg_Comprobante.Rows[e.RowIndex].Cells[2].Value; _G_Str_ValorCeldaTem = _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value.ToString().Trim();
                     }
                     else
                     {
                         MessageBox.Show("La cuenta que introdujo ya existe. Debe ingresar una cuenta diferente", "Requerimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = _G_Str_ValorCeldaTem;
                     }
                 }
                 else
                 {
                     MessageBox.Show("Debe ingresar una cuenta de detalle", "Requerimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = _G_Str_ValorCeldaTem;
                 }
             }
             _Frm.Dispose();
         }
     }
 }
Exemple #2
0
        private void _Bt_CountCapital_Click(object sender, EventArgs e)
        {
            DataSet        _Ds;
            string         _Str_CodCuenta = "", _Str_Sql = "";
            Frm_VstCuentas _Frm_Vista = new Frm_VstCuentas();

            _Frm_Vista.ShowDialog();
            _Str_CodCuenta = _Frm_Vista._Str_FrmNodeSelec;
            if (_Str_CodCuenta != "")
            {
                _Txt_CountCapital.Tag = _Str_CodCuenta;
                _Str_Sql = "SELECT cname FROM TCOUNT WHERE ccompany='" + Frm_Padre._Str_Comp + "' AND ccount='" + _Str_CodCuenta + "'";
                _Ds      = Program._MyClsCnn._mtd_conexion._Mtd_RetornarDataset(_Str_Sql);
                if (_Ds.Tables[0].Rows.Count > 0)
                {
                    _Txt_CountCapital.Text = _Str_CodCuenta + " - " + Convert.ToString(_Ds.Tables[0].Rows[0][0]);
                }
            }
            _Frm_Vista.Dispose();
        }
Exemple #3
0
 private void _Dg_Grid_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex != -1 && e.ColumnIndex == 2)
     {
         Cursor = Cursors.WaitCursor;
         Frm_VstCuentas _Frm = new Frm_VstCuentas();
         Cursor = Cursors.Default;
         _Frm.ShowDialog();
         if (_Frm._Str_FrmNodeSelec.Trim().Length > 0)
         {
             if (_Mtd_CuentaDetalle(_Frm._Str_FrmNodeSelec.Trim()))
             {
                 _Dg_Grid.Rows[e.RowIndex].Cells[3].Value = _Frm._Str_FrmNodeSelec.Trim();
                 _Dg_Grid.Rows[e.RowIndex].Cells[4].Value = _Mtd_ObtenerDescripCuenta(_Frm._Str_FrmNodeSelec.Trim());
             }
             else
             {
                 MessageBox.Show("Debe ingresar una cuenta de detalle", "Requerimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
         _Frm.Dispose();
     }
 }
Exemple #4
0
        private void _Dg_Comprobante_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == 1 & !_Dg_Comprobante.Rows[e.RowIndex].Cells[0].ReadOnly)
                {
                    Cursor = Cursors.WaitCursor;
                    Frm_VstCuentas _Frm = new Frm_VstCuentas();
                    Cursor = Cursors.Default;
                    _Frm.ShowDialog();
                    if (_Frm._Str_FrmNodeSelec.Trim().Length > 0)
                    {
                        if (_Mtd_CuentaDetalle(_Frm._Str_FrmNodeSelec.Trim()))
                        {
                            _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = _Frm._Str_FrmNodeSelec.Trim(); _Dg_Comprobante.Rows[e.RowIndex].Cells[2].Value = _Mtd_ObtenerDescripCuenta(_Frm._Str_FrmNodeSelec.Trim()); _Str_ValorCeldaTem = _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value.ToString().Trim();

                            //CODIGO COMENTADO SEGUN TICKET 12930 - IGNACIO AL 12-02-2014
                            //if (!_Mtd_ValidarCuenta(_Frm._Str_FrmNodeSelec.Trim(), e.RowIndex))
                            //{
                            //    _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = _Frm._Str_FrmNodeSelec.Trim(); _Dg_Comprobante.Rows[e.RowIndex].Cells[2].Value = _Mtd_ObtenerDescripCuenta(_Frm._Str_FrmNodeSelec.Trim()); _Str_ValorCeldaTem = _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value.ToString().Trim();
                            //}
                            //else
                            //{
                            //    MessageBox.Show("La cuenta que introdujo ya existe. Debe ingresar una cuenta diferente", "Requerimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = "XXXX";
                            //}
                            //CODIGO COMENTADO SEGUN TICKET 12930 - IGNACIO AL 12-02-2014
                        }
                        else
                        {
                            MessageBox.Show("Debe ingresar una cuenta de detalle", "Requerimiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _Dg_Comprobante.Rows[e.RowIndex].Cells[0].Value = "XXXX";
                        }
                    }
                    _Frm.Dispose();
                }
            }
        }
Exemple #5
0
        private void _Dg_GridDeta_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            int    _Int_Val = 0;
            string _Str_CodCuenta = "", _Str_Sql = "", _Str_Auxiliar = "", _Str_CuentaName = "";

            if (_Str_MyProceso != "" && _Dg_GridDeta.RowCount > 0)
            {
                if (e.ColumnIndex == 2)//El boton de Buscar
                {
                    //Llamo al formulario de busqueda de productos
                    Frm_VstCuentas _Frm_Vista = new Frm_VstCuentas();
                    _Frm_Vista.ShowDialog();
                    _Str_CodCuenta = _Frm_Vista._Str_FrmNodeSelec;
                    if (_Str_CodCuenta != "")
                    {
                        if (_Str_CodCuenta == "PRV.X" || _Str_CodCuenta == "BNC.X")
                        {
                            _Str_Auxiliar = "";
                            if (_Str_CodCuenta == "PRV.X")
                            {
                                _Str_CuentaName = "PARAMETRO DE CUENTA DE PROVEEDOR";
                            }
                            else if (_Str_CodCuenta == "BNC.X")
                            {
                                _Str_CuentaName = "PARAMETRO DE CUENTA DE BANCO";
                            }
                        }
                        else
                        {
                            _Str_Sql = "SELECT cname FROM TCOUNT WHERE ccompany='" + Frm_Padre._Str_Comp + "' AND ccount='" + _Str_CodCuenta + "'";
                            DataSet _Ds = Program._MyClsCnn._mtd_conexion._Mtd_RetornarDataset(_Str_Sql);
                            _Str_CuentaName = Convert.ToString(_Ds.Tables[0].Rows[0]["cname"]).Trim().ToUpper();
                        }

                        if (_Mtd_ValidarGridDetaAdd(_Frm_Vista._Str_FrmNodeSelec, _Str_Auxiliar) == false)
                        {
                            _Dg_GridDeta[1, e.RowIndex].Value = _Str_CodCuenta;
                            _Dg_GridDeta[4, e.RowIndex].Value = _Str_CuentaName;
                            if (_Dg_GridDeta.RowCount == 1)
                            {
                                _Dg_GridDeta.NotifyCurrentCellDirty(true);
                                _Int_Val = 1;
                            }
                            else
                            {
                                if (Convert.ToString(_Dg_GridDeta[0, e.RowIndex].Value) == "")
                                {
                                    _Int_Val = Convert.ToInt16(_Dg_GridDeta[0, (_Dg_GridDeta.RowCount - 2)].Value) + 1;
                                    _Dg_GridDeta.NotifyCurrentCellDirty(true);
                                }
                                else
                                {
                                    _Int_Val = Convert.ToInt16(_Dg_GridDeta[0, e.RowIndex].Value);
                                }
                            }
                            _Dg_GridDeta[0, e.RowIndex].Value = _Int_Val;
                            _Dg_GridDeta[5, e.RowIndex].Value = "...";
                            _Dg_GridDeta.AllowUserToAddRows   = false;
                        }
                    }
                    _Frm_Vista = null;
                    _Dg_GridDeta.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                }
            }
        }