bool CamposOK() { bool booEstado = true; int n_row = 0; for (n_row = 2; n_row <= FgCtto.Rows.Count - 1; n_row++) { if (FgCtto.GetData(n_row, 1).ToString() == "") { MessageBox.Show("¡ No ha especificado el numero de puesto a contratar !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (FgCtto.GetData(n_row, 2).ToString() == "") { MessageBox.Show("¡ No ha especificado numero de contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (funFunciones.NulosC(FgCtto.GetData(n_row, 3)) == "") { MessageBox.Show("¡ No ha especificado la fecha de inicio del contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (funFunciones.NulosC(FgCtto.GetData(n_row, 4)) == "") { MessageBox.Show("¡ No ha especificado la fecha de termino del contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (FgCtto.GetData(n_row, 5).ToString() == "") { MessageBox.Show("¡ No ha especificado el tipo de documento de cobranza que se aplicara al contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } } return(booEstado); }
void AsignarEntidad() { if (n_QueHace == 1) { // BE_ListaReg.n_id = 0; } else { // BE_ListaReg.n_id = BE_Registro.n_id; } int n_row = 0; string c_dato = ""; lstSocPue.Clear(); for (n_row = 2; n_row <= FgCtto.Rows.Count - 1; n_row++) { BE_COO_SOCIOSPUESTOS entSocPue = new BE_COO_SOCIOSPUESTOS(); entSocPue.n_idemp = STU_SISTEMA.EMPRESAID; entSocPue.n_id = Convert.ToInt32(FgCtto.GetData(n_row, 9).ToString()); entSocPue.n_idsoc = Convert.ToInt32(FgCtto.GetData(n_row, 8).ToString()); entSocPue.n_idpue = Convert.ToInt32(FgCtto.GetData(n_row, 7).ToString()); entSocPue.c_puesto = FgCtto.GetData(n_row, 1).ToString(); entSocPue.c_numctt = FgCtto.GetData(n_row, 2).ToString(); entSocPue.d_fchini = Convert.ToDateTime(FgCtto.GetData(n_row, 3).ToString()); entSocPue.d_fchfin = Convert.ToDateTime(FgCtto.GetData(n_row, 4).ToString()); if (FgCtto.GetData(n_row, 6).ToString() == "ACTIVO") { entSocPue.n_activo = 1; } else { entSocPue.n_activo = 2; } c_dato = FgCtto.GetData(n_row, 5).ToString(); c_dato = funDatos.DataTableBuscar(dtDocCom, "c_des", "n_id", c_dato, "C").ToString(); entSocPue.n_idtipdocemi = Convert.ToInt32(c_dato); if (funFunciones.NulosC(FgCtto.GetData(n_row, 10)) != "") { entSocPue.d_fchter = Convert.ToDateTime(FgCtto.GetData(n_row, 10).ToString()); } lstSocPue.Add(entSocPue); } }
private void CmdAddCtt_Click(object sender, EventArgs e) { if (n_QueHace == 3) { return; } if (funFunciones.NulosC(FgCtto.GetData(FgCtto.Rows.Count - 1, 1)) == "") { MessageBox.Show("¡ No ha especificado el puesto para el ultimo registro agregado !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return; } booAgregando = true; FgCtto.Rows.Count = FgCtto.Rows.Count + 1; string c_dato = ""; c_dato = LblIdSocio.Text; FgCtto.SetData(FgCtto.Rows.Count - 1, 8, c_dato); // ID DEL SOCIO FgCtto.SetData(FgCtto.Rows.Count - 1, 9, "0"); // ID DEL REGISTRO FgCtto.SetData(FgCtto.Rows.Count - 1, 6, "ACTIVO"); // ESTADO DEL REGISTRO POR DEFAULT ACTIVO CUANDO ES NUEVO booAgregando = false; }
private void CmdTermCtto_Click(object sender, EventArgs e) { FgCtto.SetData(FgCtto.Row, 6, "VENCIDO"); FgCtto.SetData(FgCtto.Row, 10, DateTime.Today.ToString("dd/MM/yy")); }
private void FgCtto_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { FgCtto.AllowEditing = false; return; } if (booAgregando == true) { return; } if (FgCtto.Col == 1) { string c_dato = ""; c_dato = FgCtto.GetData(FgCtto.Row, 1).ToString(); c_dato = funDatos.DataTableBuscar(dtPuestos, "c_puesto", "n_id", c_dato, "C").ToString(); FgCtto.SetData(FgCtto.Row, 7, c_dato); FgCtto.SetData(FgCtto.Row, 8, LblIdSocio.Text); FgCtto.Select(e.Row - 1, 2); return; } //if (FgCtto.Col == 2) //{ // MostrarUnidadMedida(e.Row, FgCtto.GetData(e.Row, 2).ToString()); // GenerarNumeroLote(e.Row, FgCtto.GetData(e.Row, 2).ToString()); // FgItems.Select(e.Row - 1, 3); // return; //} //if (FgCtto.Col == 3) //{ // FgCtto.Select(e.Row - 1, 4); // return; //} //if (FgCtto.Col == 4) //{ // FgCtto.Select(e.Row - 1, 5); // return; //} //if (FgCtto.Col == 5) //{ // FgCtto.SetData(FgCtto.Row, 5, FgCtto.GetData(FgCtto.Row, 5).ToString().ToUpper()); // FgCtto.Select(e.Row - 1, 6); // return; //} //if (FgCtto.Col == 6) //{ // booAgregando = true; // FgCtto.SetData(e.Row, 7, ""); // FgCtto.SetData(e.Row, 8, ""); // FgCtto.Select(e.Row - 1, 7); // booAgregando = false; // return; //} //if (FgItems.Col == 7) //{ // booAgregando = true; // FgCtto.SetData(e.Row, 8, ""); // FgCtto.Select(e.Row - 1, 8); // booAgregando = false; // return; //} //if (FgCtto.Col == 8) //{ // FgCtto.Select(e.Row - 1, 9); // return; //} //if (FgCtto.Col == 9) //{ // FgCtto.Select(e.Row - 1, 10); // return; //} //if (FgCtto.Col == 10) //{ // FgItems.Select(e.Row, 2); // return; //} }
void VerRegistro(int n_IdRegistro) { LblIdSocio.Text = n_IdRegistro.ToString(); // ID DEL REGISTRO ES EL ID DEL SOCIOS MENDIANTE EL CUAL SE REALIZA LA BUSQUEDA string c_dato = ""; DataTable dtResult = new DataTable(); FgCtto.Rows.Count = 2; objRegistros.mysConec = mysConec; objRegistros.TraerRegistro(n_IdRegistro); lstSocPue = objRegistros.lstSociosPuestos; // MOSTRAMOS EL NOMBRE DEL SOCIO c_dato = n_IdRegistro.ToString(); dtResult = funDatos.DataTableFiltrar(dtSocios, "n_id = " + c_dato + ""); if (dtResult.Rows.Count != 0) { TxtNomSoc.Text = dtResult.Rows[0]["c_apenom"].ToString(); TxtNumDoc.Text = dtResult.Rows[0]["c_idenumdoc"].ToString(); // MOSTRAMOS EL TIPO DE SOCIO c_dato = dtResult.Rows[0]["n_idtipsoc"].ToString(); dtResult = funDatos.DataTableFiltrar(dtTipSoc, "n_id = " + c_dato + ""); if (dtResult.Rows.Count != 0) { TxtTipSoc.Text = dtResult.Rows[0]["c_des"].ToString(); } } //MOSTRAMOS LA LISTA DE PUESTOS int n_row = 0; booAgregando = true; for (n_row = 0; n_row <= lstSocPue.Count - 1; n_row++) { FgCtto.Rows.Count = FgCtto.Rows.Count + 1; c_dato = lstSocPue[n_row].n_idpue.ToString(); c_dato = funDatos.DataTableBuscar(dtPuestos, "n_id", "c_puesto", c_dato, "N").ToString(); FgCtto.SetData(FgCtto.Rows.Count - 1, 1, c_dato); FgCtto.SetData(FgCtto.Rows.Count - 1, 2, lstSocPue[n_row].c_numctt.ToString()); if (lstSocPue[n_row].d_fchini.ToString() != "") { FgCtto.SetData(FgCtto.Rows.Count - 1, 3, lstSocPue[n_row].d_fchini); } if (lstSocPue[n_row].d_fchfin.ToString() != "") { FgCtto.SetData(FgCtto.Rows.Count - 1, 4, lstSocPue[n_row].d_fchfin); } c_dato = lstSocPue[n_row].n_idtipdocemi.ToString(); c_dato = funDatos.DataTableBuscar(dtDocCom, "n_id", "c_des", c_dato, "N").ToString(); FgCtto.SetData(FgCtto.Rows.Count - 1, 5, c_dato); if (lstSocPue[n_row].n_activo == 1) { c_dato = "ACTIVO"; } else { c_dato = "VENCIDO"; } FgCtto.SetData(FgCtto.Rows.Count - 1, 6, c_dato); FgCtto.SetData(FgCtto.Rows.Count - 1, 7, lstSocPue[n_row].n_idpue.ToString()); FgCtto.SetData(FgCtto.Rows.Count - 1, 8, lstSocPue[n_row].n_idsoc.ToString()); FgCtto.SetData(FgCtto.Rows.Count - 1, 9, lstSocPue[n_row].n_id.ToString()); if (lstSocPue[n_row].d_fchter.ToString() != "") { FgCtto.SetData(FgCtto.Rows.Count - 1, 10, lstSocPue[n_row].d_fchter); } } booAgregando = false; }