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(); } } }
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(); }
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(); } }
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(); } } }