private void button9_Click(object sender, EventArgs e) { string numeroPoliza = Convert.ToString(dtggrid.Rows[this.row].Cells[11].Value); string tipopoliza = Convert.ToString(dtggrid.Rows[this.row].Cells[12].Value); string prefijo = Convert.ToString(dtggrid.Rows[this.row].Cells[13].Value); string mes = tabControl1.SelectedIndex < 10 ? $"0{tabControl1.SelectedIndex}" : tabControl1.SelectedIndex.ToString(); string query = $"select * from cg_fondos.des where entidad = '801' and subsistema = 'P' AND poltipo = '{tipopoliza}' and polmes = '{mes}' and anio = {txtanio.Text} and prefijo = '{prefijo}' and polnumero = '{numeroPoliza}'"; Dictionary <string, object> diccionario = globales.consulta(query)[0]; switch (Convert.ToString(diccionario["poltipo"])) { case "D": diccionario.Add("tipopol", "DIARIO"); break; case "E": diccionario.Add("tipopol", "EGRESO"); break; case "I": diccionario.Add("tipopol", "INGRESO"); break; } frmLibroDiarioDetalle diario = new frmLibroDiarioDetalle(mes, Convert.ToInt32(txtanio.Text), numeroPoliza, tipopoliza, diccionario, lblabierto.Visible); globales.showModal(diario); }
private void button9_Click(object sender, EventArgs e) { if (this.dtggrid.Rows.Count == 0) { return; } DataGridViewRow dato = this.dtggrid.Rows[this.row]; string numpoliza = Convert.ToString(dato.Cells[7].Value); string fecha = Convert.ToString(dato.Cells[9].Value); string polmes = this.tabControl1.SelectedIndex < 10 ? $"0{this.tabControl1.SelectedIndex}" : $"{this.tabControl1.SelectedIndex}"; string tipopol = string.Empty; string concepto = Convert.ToString(dato.Cells[2].Value); string nombreTipoPol = string.Empty; if (comboBox1.SelectedIndex == 0) { tipopol = "D"; nombreTipoPol = "Diario"; } else if (comboBox1.SelectedIndex == 1) { tipopol = "E"; nombreTipoPol = "Egresos"; } else { tipopol = "I"; nombreTipoPol = "Ingresos"; } string query = $"select nombre from catalogos.usuarios where idusuario = {dato.Cells[9].Value}"; List <Dictionary <string, object> > resultado = globales.consulta(query); string elaboro = "USUARIO ANTERIOR CG"; if (resultado.Count != 0) { elaboro = Convert.ToString(resultado[0]["nombre"]); } Dictionary <string, object> obj = new Dictionary <string, object>(); obj.Add("tipopol", nombreTipoPol); obj.Add("prefijo", (dato.Cells[8].Value)); obj.Add("fecha", fecha); obj.Add("elaboro", elaboro); obj.Add("concepto", concepto); frmLibroDiarioDetalle detalle = new frmLibroDiarioDetalle(polmes, Convert.ToInt16(this.txtanio.Text), numpoliza, tipopol, obj, this.lblabierto.Visible); globales.showModal(detalle); }
private void button9_Click(object sender, EventArgs e) { if (this.dtggrid.Rows.Count == 0) { return; } DataGridViewRow item = this.dtggrid.Rows[this.row]; string descripcionpol = Convert.ToString(item.Cells[9].Value); string numeropoliza = Convert.ToString(item.Cells[2].Value).Substring(3, 7); string prefijo = Convert.ToString(item.Cells[8].Value); string polmes = tabControl1.SelectedIndex < 10 ? $"0{tabControl1.SelectedIndex}" : $"{tabControl1.SelectedIndex}"; string fecha = Convert.ToString(item.Cells[1].Value) + "/" + $"{polmes}" + "/" + txtanio.Text; string tipopol = Convert.ToString(item.Cells[2].Value).Substring(0, 1); string concepto = Convert.ToString(item.Cells[9].Value); string nombretipo = string.Empty; if (tipopol == "D") { tipopol = "D"; nombretipo = "DIARIO"; } else if (tipopol == "E") { nombretipo = "EGRESOS"; } else if (tipopol == "I") { nombretipo = "INGRESOS"; } string elaboro = "USUARIO ANTERIOR CG"; Dictionary <string, object> obj = new Dictionary <string, object>(); obj.Add("tipopol", nombretipo); obj.Add("prefijo", (item.Cells[8].Value)); obj.Add("fecha", fecha); obj.Add("elaboro", elaboro); obj.Add("concepto", concepto); frmLibroDiarioDetalle detalle = new frmLibroDiarioDetalle(polmes, Convert.ToInt16(this.txtanio.Text), numeropoliza, tipopol, obj, this.lblabierto.Visible); globales.showModal(detalle); }