private void MyRefresh() { DateTime dateNow = System.DateTime.Now; string mes = string.Empty; switch (dateNow.Month) { case 1: mes = "enero"; break; case 2: mes = "febrero"; break; case 3: mes = "marzo"; break; case 4: mes = "abril"; break; case 5: mes = "mayo"; break; case 6: mes = "junio"; break; case 7: mes = "julio"; break; case 8: mes = "agosto"; break; case 9: mes = "septiembre"; break; case 10: mes = "octubre"; break; case 11: mes = "noviembre"; break; case 12: mes = "diciembre"; break; } txtFecha = dateNow.Day.ToString() + " de " + mes + " de " + dateNow.Year.ToString("####"); string[] data = Nombre.Split('-'); Partido = data[0].Trim(); NumCandidato = data[1].Trim(); string[] mItotalEndoReq; using (SqlExcuteCommand get = new SqlExcuteCommand() { DBRadicacionesCEECnnStr = DBEndososCnnStr // DBRadicacionesCEECnnStr }) { mItotalEndoReq = get.MyGetTotalEndosReqPartido(Partido); //get.MyGetTotalReq(NumCandidato); } int total = 0; int.TryParse(mItotalEndoReq[5].Trim(), out total); Total = total; Nombre = mItotalEndoReq[2].Trim(); // data[2].Trim(); //if (dataReydi[2].Trim().Length > 0) // Nombre += " " + dataReydi[2].Trim(); //if (dataReydi[3].Trim().Length > 0) //{ // if (dataReydi[3].Trim().Length ==1) // Nombre += " " + dataReydi[3].Trim() + "."; // else // Nombre += " " + dataReydi[3].Trim(); //} //if (dataReydi[4].Trim().Length > 0) // Nombre += " " + dataReydi[4].Trim(); Cargo = data[4].Trim(); txtNombre = Nombre.ToUpper(); // ConvertTo_ProperCase(Nombre); switch (Cargo) { case "0": //Partido Cargo = "Partido"; break; case "1": //isla Cargo = "Gobernador"; break; case "2": //isla Cargo = "Comisionado Residente"; break; case "3": { string[] temp = Area.Split('-'); //SENADOR DISTRITO 1 SAN JUAN temp[1] = temp[1].Trim().Substring(19); Cargo = "Senador Distrito "; Cargo += temp[1].Trim(); break; } case "4": //isla Cargo = "Senador por Acumulación "; //Cargo = Area; break; case "5": { Cargo = "Representante Distrito "; //5011 - REP. DIST. 11 string[] temp = Area.Split('-'); temp[1] = temp[1].Replace("REP. DIST. ", "Representante Distrito "); Cargo = temp[1].Trim(); break; } case "6": //isla Cargo = "Representante por Acumulación "; //Cargo = Area; break; case "7": { Cargo = "Alcalde "; string[] temp = Area.Split('-'); Cargo += temp[1].Trim(); break; } case "8": { string[] temp = Area.Split('-'); Cargo = "Asambleista "; Cargo += temp[1].Trim(); break; } } txtCargo = Cargo.ToUpper(); using (SqlExcuteCommand get = new SqlExcuteCommand() { DBCnnStr = DBEndososCnnStr, DBRadicacionesCEECnnStr = DBRadicacionesCEECnnStr }) { DataTable t = get.MyGetBodyCertificacion(); foreach (DataRow row in t.Rows) { txtHUpDerecha = row["HupDerecho"].ToString(); txtFecha = txtFecha; txtInfoSecretario = row["InfoSecretario"].ToString(); txtInfoComisionado = row["InfoComisionado"].ToString(); txtP1Body = row["P1Body"].ToString(); txtP2Body = row["P2Body"].ToString(); txtInfoDirectorValidaciones = row["InfoDirectorValidaciones"].ToString(); txtDireccionPostal = row["DireccionPostal"].ToString(); txtTelefono = row["Telefono"].ToString(); txtLogo = row["LogoPath"].ToString(); txtColor = row["Color"].ToString(); txtPageHeader = row["PageHeader"].ToString(); Template = byte.Parse(row["Template"].ToString()); txtFirma = row["FirmaPath"].ToString(); } } }