protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { ManejoDatos datos = new ManejoDatos(); var bs1 = new System.Windows.Forms.BindingSource(); bs1.DataSource = datos.getEstudiantesBusqueda(TextBox1.Text); GridView1.DataSource = bs1; //<-- notes it takes the entire bindingSource GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); // Label1.Text = "Correcto"; GridView1.DataBind(); }
private void cargarDatos() { ManejoDatos md = new ManejoDatos(); //Sesion List <string> sesion = new List <string>(); sesion.Add("Ordinaria"); sesion.Add("Extraordinaria"); ddlSesion.DataSource = sesion; ddlSesion.DataBind(); //Nombres de Dias List <string> dias = md.ObtenerDiasSemana(); ddlNombreDia.DataSource = dias; ddlNombreDia.DataBind(); //Dias del mes List <string> numerosMes = md.ObtenerDiasMes(); ddlNumeroDia.DataSource = numerosMes; ddlNumeroDia.DataBind(); ddlNumeroDia0.DataSource = numerosMes; ddlNumeroDia0.DataBind(); //Meses List <string> meses = md.ObtenerMeses(); ddlMes.DataSource = meses; ddlMes.DataBind(); ddlMes0.DataSource = meses; ddlMes0.DataBind(); //Carreras ManejoDatos datos = new ManejoDatos(); List <string> modelo = datos.getCarreras(); List <string> modeloMin = datos.GetCarrerasMinuscula(); List <string> modeloCarr = datos.GetCarrerasFooter(); ddlCarrera.DataSource = modeloMin; ddlCarrera.DataBind(); ddlCarrera0.DataSource = modelo; ddlCarrera0.DataBind(); ddlCarreras.DataSource = modeloCarr; ddlCarreras.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { panelModalBusquedaEst.Visible = true; ModalPopupExtender1.Show(); // Label1.Text = "Buscando"; ManejoDatos datos = new ManejoDatos(); // List<Estudiante> listado = var bs1 = new BindingSource(); bs1.DataSource = datos.getEstudiantesBusqueda(TextBox1.Text); GridView1.DataSource = bs1; //<-- notes it takes the entire bindingSource GridView1.DataBind(); // Label1.Text = "Correcto"; }
protected void btnEliminar_Click(object sender, EventArgs e) { ManejoDatos manejoDatos = new ManejoDatos(); bool result = manejoDatos.eliminarUsuario(txtCedula.Text); if (result == true) { lblMensaje.Text = "usuario eliminado"; } else { lblMensaje.Text = "no se pudo eliminar el usuario"; } }
private void cargarResoluciones() { ManejoDatos datos = new ManejoDatos(); // string idConsejo = Session["CONSEJO"].ToString(); string idConsejo = ((ConsejoDir)Session["CONSEJO"]).Codigo; List <ResolucionVista> resoluciones = datos.ObtenerResolucionesVista(idConsejo); ViewState["RESOLUCIONES"] = resoluciones; var bs1 = new BindingSource(); bs1.DataSource = resoluciones; gvResoluciones.DataSource = bs1; //<-- notes it takes the entire bindingSource gvResoluciones.DataBind(); }
protected void btnCrear_Click(object sender, EventArgs e) { if ( !txtFecha.Text.Equals("") && !txtCedula.Text.Equals("") && !txtClave.Text.Equals("") ) { string reunion = ""; if (DropDownList1.SelectedIndex == 0) { reunion = "O"; } else { reunion = "E"; } UsuariosSW admin = ((UsuariosSW)Session["USUARIOSW"]);//UsuariosSW string cedulaUser = admin.Cedula; ManejoDatos datos = new ManejoDatos(); Resultado generado = datos.crearConsejo( txtFecha.Text, txtCedula.Text, txtClave.Text , cedulaUser, reunion ); if (generado.Completo == true) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Consejo creado !')", true); } else if (!generado.Error.Equals("")) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + generado.Error + " !')", true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Error en el procedimiento !')", true); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
void AgragarUsuario() { if (txtNombreUno.Text.Length == 0 || txtCedula.Text.Length == 0 || txtNombreDos.Text.Length == 0 || txtApellidoM.Text.Length == 0 || txtApellidoP.Text.Length == 0 || txtClave.Text.Length == 0 || txtConfirmacionClave.Text.Length == 0 || txtEmail.Text.Length == 0 || ddlRol.SelectedIndex == -1) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar todos los campos.. !')", true); // lblMensaje.Text = "Datos incompletos, porfavor complete todos los campos del formulario"; } else { if (!txtClave.Text.Equals(txtConfirmacionClave.Text)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar todos los campos.. !')", true); // lblMensaje.Text = "Las contraseñas no coincide"; } else { UsuarioEntity usuar = new UsuarioEntity(); usuar.Cedula = txtCedula.Text; usuar.Nombres = (txtNombreUno.Text + " " + txtNombreDos.Text).ToUpper(); usuar.Apellidos = (txtApellidoP.Text + " " + txtApellidoM.Text).ToUpper(); usuar.Clave = txtClave.Text.ToUpper(); usuar.Correo = txtEmail.Text.ToUpper(); if (ddlRol.SelectedIndex == 1) { id = 'S'; } else { id = 'A'; } usuar.Tipo = id.ToString().ToUpper(); ManejoDatos mn = new ManejoDatos(); bool result = mn.guardarDatosUsuario(usuar); if (result == true) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Usuario insertado.. !')", true); // lblMensaje.Text = "Usuario insertado con exito"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('No se pudo insertar.. !')", true); } } } }
private void buttonSumaNotas_Click(object sender, EventArgs e) { ManejoDatos objmanejoDatos = new ManejoDatos(); switch (X) { case 1: textBoxSumaNotas.Text = (objmanejoDatos.sumarNotas(NotasParcial1)).ToString(); break; case 2: textBoxSumaNotas.Text = (objmanejoDatos.sumarNotas(NotasParcial2)).ToString(); break; case 3: textBoxSumaNotas.Text = (objmanejoDatos.sumarNotas(NotasParcial3)).ToString(); break; } }
private void buttonNotaMin_Click(object sender, EventArgs e) { ManejoDatos objmanejoDatos = new ManejoDatos(); switch (X) { case 1: textBoxNotaMin.Text = (objmanejoDatos.numeroMenor(NotasParcial1)).ToString(); break; case 2: textBoxNotaMin.Text = (objmanejoDatos.numeroMenor(NotasParcial2)).ToString(); break; case 3: textBoxNotaMin.Text = (objmanejoDatos.numeroMenor(NotasParcial3)).ToString(); break; } }
private void buttonPromedio_Click(object sender, EventArgs e) { ManejoDatos objmanejoDatos = new ManejoDatos(); switch (X) { case 1: textBoxPromedio.Text = (objmanejoDatos.Promedio(NotasParcial1)).ToString(); break; case 2: textBoxPromedio.Text = (objmanejoDatos.Promedio(NotasParcial2)).ToString(); break; case 3: textBoxPromedio.Text = (objmanejoDatos.Promedio(NotasParcial3)).ToString(); break; } }
private void buttonNombres_Click(object sender, EventArgs e) { try { ClsArchivo objarchiv = new ClsArchivo(); Datos = objarchiv.cargarDatos(ArregloNombres); ClsArreglos ObjArreglos = new ClsArreglos(Datos); resultado = ObjArreglos.MetodoBurbuja(); ManejoDatos objmanejoDatos = new ManejoDatos(); Nombres = objmanejoDatos.columnas(resultado, 0); NotasParcial1 = objmanejoDatos.columnas(resultado, 1); NotasParcial2 = objmanejoDatos.columnas(resultado, 2); NotasParcial3 = objmanejoDatos.columnas(resultado, 3); for (int indice = 0; indice < Nombres.Length; indice++) { listBoxResutado.Items.Add(Nombres[indice]); } } catch (Exception ex) { MessageBox.Show("Necesita carga un archivo plano para poder ejecutar el programa." + ex); } }
void ActualizarUsuario() { if (txtNombreUno.Text.Length == 0 || txtCedula.Text.Length == 0 || txtNombreDos.Text.Length == 0 || txtApellidoM.Text.Length == 0 || txtApellidoP.Text.Length == 0 || txtClave.Text.Length == 0 || txtConfirmacionClave.Text.Length == 0 || txtEmail.Text.Length == 0 || ddlRol.SelectedIndex == -1) { lblMensaje.Text = "Datos incompletos, porfavor complete todos los campos del formulario"; } else { if (!txtClave.Text.Equals(txtConfirmacionClave.Text)) { lblMensaje.Text = "Las contraseñas no coincide"; } else { UsuarioEntity usuar = new UsuarioEntity(); usuar.Cedula = txtCedula.Text; usuar.Nombres = txtNombreUno.Text + " " + txtNombreDos.Text; usuar.Apellidos = txtApellidoP.Text + " " + txtApellidoM.Text; usuar.Clave = txtClave.Text; usuar.Correo = txtEmail.Text; usuar.Tipo = id.ToString(); ManejoDatos mn = new ManejoDatos(); bool res = mn.actualizarDatosUsuario(usuar); if (res == true) { lblMensaje.Text = "Usuario actualizado con exito"; } else { lblMensaje.Text = "No se pudo actualizar al usuario"; } } } }
protected void Page_Load(object sender, EventArgs e) { /* List<Estudiante> listado = new List<Estudiante>(); * ManejoDatos datos = new ManejoDatos(); * listado= datos.getAllEstudiantes(); * Session["Estudiantes"] = listado;*/ if (ViewState["nombre"] != null) { txtNombreEstu1.Text = ViewState["nombre"].ToString(); txtNombreEstu1.Text = ViewState["nombre"].ToString(); } if (!IsPostBack) { List <String> dias = new List <string>(); for (int i = 1; i <= 31; i++) { dias.Add(i.ToString()); } ddlDia.DataSource = dias; ddlDia.DataBind(); ddlDia0.DataSource = dias; ddlDia0.DataBind(); List <String> meses = new List <string>(); meses.Add("enero"); meses.Add("febrero"); meses.Add("marzo"); meses.Add("abril"); meses.Add("mayo"); meses.Add("junio"); meses.Add("julio"); meses.Add("agosto"); meses.Add("septiembre"); meses.Add("octubre"); meses.Add("noviembre"); meses.Add("diciembre"); List <string> sesion = new List <string>(); sesion.Add("Ordinaria"); sesion.Add("Extraordinaria"); ddlSesion.DataSource = sesion; ddlSesion.DataBind(); ddlMes.DataSource = meses; ddlMes.DataBind(); ddlMes0.DataSource = meses; ddlMes0.DataBind(); ManejoDatos mysql = new ManejoDatos(); dropDownCoord.DataSource = mysql.ObtenerCarrerasCoord(); dropDownCoord.DataBind(); List <string> modelo = mysql.getCarreras(); ddlExCarreras.DataSource = modelo; ddlExCarreras.DataBind(); ddlExCarreras0.DataSource = modelo; ddlExCarreras0.DataBind(); List <string> carreas = mysql.getCarreras(); List <string> carreasMin = new List <string>(); foreach (string item in carreas) { carreasMin.Add(item.ToLower()); } ddlCarreraComsion.DataSource = carreasMin; ddlCarreraComsion.DataBind(); } }
protected void Button4_Click(object sender, EventArgs e) { /*Editables Y Datos*/ List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFecha.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anio0>"); datos.Add(txtAnio.Text); editables.Add("<presidente>"); datos.Add(txtPresidente.Text); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue.ToString()); editables.Add("<nombredia>"); datos.Add(ddlNombreDia.SelectedValue.ToString()); editables.Add("<numerodia>"); datos.Add(ddlNumeroDia.SelectedValue.ToString()); editables.Add("<nombremes>"); datos.Add(ddlMes.SelectedValue.ToString()); editables.Add("<anio>"); datos.Add(txtAnio0.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombremes1>"); datos.Add(ddlMes0.SelectedValue.ToString()); editables.Add("<numerodia1>"); datos.Add(ddlNumeroDia0.SelectedValue.ToString()); editables.Add("<anio1>"); datos.Add(txtAnio1.Text); editables.Add("<presidente1>"); datos.Add(txtPresidente0.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu.Text); editables.Add("<carrera>"); datos.Add(ddlCarrera.SelectedValue.ToString()); editables.Add("<estudiante1>"); datos.Add(txtNombreEstu0.Text); editables.Add("<carrera1>"); datos.Add(ddlCarrera0.SelectedValue.ToString()); editables.Add("<estudiante2>"); datos.Add(txtNombreEstu1.Text); editables.Add("<presidenta>"); datos.Add(txtPresidente1.Text); editables.Add("<coordinadorcar>"); datos.Add(txtCoordinador.Text); editables.Add("<carrera2>"); datos.Add(ddlCarreras.SelectedValue.ToString()); /**/ StringBuilder sb1 = new StringBuilder(); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); String plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\Titulacion\AprobacionModalidadProyectoInvestigacion.docx"; ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; resol.IDConsejo = txtCodigoConsejoDestino.Text; if (ViewState["CEDULA_EST"] != null) { resol.Estudiante = ViewState["CEDULA_EST"].ToString(); } resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado && resol.Estudiante != null) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
private void cargarDatos() { List <string> carreras = new ManejoDatos().getCarreras(); ddlCarreras.DataSource = carreras; ddlCarreras.DataBind(); ddlCarreras0.DataSource = carreras; ddlCarreras0.DataBind(); List <String> datos = new List <string>(); datos.Add("lunes"); datos.Add("martes"); datos.Add("miércoles"); datos.Add("jueves"); datos.Add("viernes"); datos.Add("sábado"); datos.Add("domingo"); ddlNombreDia.DataSource = datos; ddlNombreDia.DataBind(); //ddlPresidente.DataSource = datos; // ddlPresidente.DataBind(); List <String> dias = new List <string>(); for (int i = 1; i <= 31; i++) { dias.Add(i.ToString()); } ddlNumeroDia.DataSource = dias; ddlNumeroDia.DataBind(); ddlNumeroDia0.DataSource = dias; ddlNumeroDia0.DataBind(); List <String> meses = new List <string>(); meses.Add("enero"); meses.Add("febrero"); meses.Add("marzo"); meses.Add("abril"); meses.Add("mayo"); meses.Add("junio"); meses.Add("julio"); meses.Add("agosto"); meses.Add("septiembre"); meses.Add("octubre"); meses.Add("noviembre"); meses.Add("diciembre"); List <string> sesion = new List <string>(); sesion.Add("Ordinaria"); sesion.Add("Extraordinaria"); ddlSesion.DataSource = sesion; ddlSesion.DataBind(); ddlMes.DataSource = meses; ddlMes.DataBind(); ddlMes0.DataSource = meses; ddlMes0.DataBind(); }
protected void Button4_Click(object sender, EventArgs e) { List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFechaHeader.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anioReso>"); datos.Add(txtAnio2.Text); editables.Add("<coordinador>"); datos.Add(txtCoordinador.Text); editables.Add("<carreraCoor>"); datos.Add(ddlCarreras.SelectedValue); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue); editables.Add("<nombreDia>"); datos.Add(ddlNombreDia.SelectedValue); editables.Add("<numeroDia>"); datos.Add(ddlNumeroDia.SelectedValue); editables.Add("<nombreMes>"); datos.Add(ddlMes.SelectedValue); editables.Add("<anioSesion>"); datos.Add(txtAnio.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombreMes1>"); datos.Add(ddlMes0.SelectedValue); editables.Add("<numeroDia1>"); datos.Add(ddlNumeroDia0.SelectedValue); editables.Add("<anioAcuerdo>"); datos.Add(txtAnio3.Text); editables.Add("<presidenteConsejo>"); datos.Add(txtPresidente.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu1.Text); editables.Add("<cedula>"); datos.Add(txtCedula.Text); editables.Add("<carrera>"); datos.Add(ddlCarreras1.SelectedValue.ToString()); editables.Add("<carreraGuardado>"); datos.Add(ddlCarreras0.SelectedValue.ToString()); editables.Add("<carrera1>"); datos.Add(txtCarrera2.Text); editables.Add("<facultad>"); datos.Add(txtFacultad.Text); editables.Add("<presidente1>"); datos.Add(txtPresidente1.Text); // StringBuilder sb1 = new StringBuilder(); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio2.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio2.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); // String plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\CulturaFisica.docx"; //continuar = CreateWordDocument(plantilla, sb1.ToString()); ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; // resol.IDConsejo = 30; resol.IDConsejo = txtCodigoConsejoDestino.Text; resol.Estudiante = txtCedula.Text; resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }
private void cargarDatos() { //Sesion List <string> sesion = new List <string>(); sesion.Add("Ordinaria"); sesion.Add("Extraordinaria"); ddlSesion.DataSource = sesion; ddlSesion.DataBind(); //Nombres de Dias List <string> dias = new List <string>(); dias.Add("lunes"); dias.Add("martes"); dias.Add("miércoles"); dias.Add("jueves"); dias.Add("viernes"); dias.Add("sábado"); dias.Add("domingo"); ddlNombreDia.DataSource = dias; ddlNombreDia.DataBind(); //Dias del mes List <int> numeros = new List <int>(); for (int i = 1; i < 32; i++) { numeros.Add(i); } ddlDiaNum.DataSource = numeros; ddlDiaNum.DataBind(); ddlDiaNum0.DataSource = numeros; ddlDiaNum0.DataBind(); /*ddlDiaNum1.DataSource = numeros; * ddlDiaNum1.DataBind(); * * ddlDiaNum2.DataSource = numeros; * ddlDiaNum2.DataBind();*/ //Meses List <string> meses = new List <string>(); meses.Add("enero"); meses.Add("febrero"); meses.Add("marzo"); meses.Add("abril"); meses.Add("mayo"); meses.Add("junio"); meses.Add("julio"); meses.Add("agosto"); meses.Add("septiembre"); meses.Add("octubre"); meses.Add("noviembre"); meses.Add("diciembre"); ddlMes.DataSource = meses; ddlMes.DataBind(); ddlMes0.DataSource = meses; ddlMes0.DataBind(); //Carreras ManejoDatos datos = new ManejoDatos(); List <string> modelo = datos.getCarreras(); ddlIndex.DataSource = datos.GetCarrerasBanner(); ddlIndex.DataBind(); ddlCarreras.DataSource = modelo; ddlCarreras.DataBind(); ddlCarreras0.DataSource = modelo; ddlCarreras0.DataBind(); }
protected void Button4_Click(object sender, EventArgs e) { /*Editables Y Datos*/ List <string> editables = new List <string>(); List <string> datos = new List <string>(); editables.Add("<fecha>"); datos.Add(txtFecha.Text); editables.Add("<secuencia>"); datos.Add(txtSecuencia.Text); editables.Add("<anio>"); datos.Add(txtAnio.Text); editables.Add("<coordinador>"); datos.Add(txtCoordinador.Text); editables.Add("<carrerasCoor>"); datos.Add(txtCarrerasCoorD.SelectedValue.ToString()); editables.Add("<sesion>"); datos.Add(ddlSesion.SelectedValue.ToString()); editables.Add("<nombreDia>"); datos.Add(ddlNombreDia.SelectedValue.ToString()); editables.Add("<numeroDia>"); datos.Add(ddlDiaNum.SelectedValue.ToString()); editables.Add("<nombreMes>"); datos.Add(ddlMes.SelectedValue.ToString()); editables.Add("<anio1>"); datos.Add(txtAnio1.Text); editables.Add("<acuerdo>"); datos.Add(txtAcuerdo.Text); editables.Add("<nombreMes1>"); datos.Add(ddlMes0.SelectedValue.ToString()); editables.Add("<numeroDia1>"); datos.Add(ddlDiaNum0.SelectedValue.ToString()); editables.Add("<anio2>"); datos.Add(txtAnio2.Text); editables.Add("<presidenteConsejo>"); datos.Add(txtPresiConsejo.Text); editables.Add("<estudiante>"); datos.Add(txtNombreEstu1.Text); editables.Add("<cedula>"); datos.Add(txtCedula.Text); editables.Add("<excarrera>"); datos.Add(ddlExCarreras.SelectedValue.ToString()); editables.Add("<periodoAcade>"); datos.Add(txtPeriodo.Text); editables.Add("<resolucion>"); datos.Add(txtResolucion.Text); editables.Add("<nombreMes2>"); datos.Add(ddlMes1.SelectedValue.ToString()); editables.Add("<numeroDia2>"); datos.Add(ddlDiaNum1.SelectedValue.ToString()); editables.Add("<anio3>"); datos.Add(txtAnio3.Text); editables.Add("<memo>"); datos.Add(txtMemo.Text); editables.Add("<numeroDia3>"); datos.Add(ddlDiaNum2.SelectedValue.ToString()); editables.Add("<nombreMes3>"); datos.Add(ddlMes2.SelectedValue.ToString()); editables.Add("<anio4>"); datos.Add(txtAnio4.Text); editables.Add("<suscriptor>"); datos.Add(txtSuscriptor.Text); editables.Add("<cargoSuscriptor>"); datos.Add(txtCargoSuscriptor.Text); editables.Add("<presidente>"); datos.Add(txtPresidente.Text); /**/ StringBuilder sb1 = new StringBuilder(); //sb1.Append(@"D:\Documentos\Pruebas\"); // sb1.Append(@"\\40.84.223.115\formatos\Documentos\Pruebas\"); sb1.Append(@"Y:\Documentos\Pruebas\"); StringBuilder sb2 = new StringBuilder(); sb2.Append("Resolucion"); sb2.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio1.Text); StringBuilder codigo = new StringBuilder(); codigo.Append(txtSecuencia.Text).Append("-P-CD-FISEI-UTA-").Append(txtAnio1.Text); sb1.Append(sb2.ToString()); sb1.Append(".docx"); string resolucion = codigo.ToString(); string ruta = sb1.ToString(); // var plantilla = @"\\40.84.223.115\formatos\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"D:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"D:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; // var plantilla = @"\\40.84.223.115\formatos\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; var plantilla = @"Y:\Documentos\OficiosPlantilla\Sistemas\actualizacionConocimientos.docx"; ManejoDatos mysql = new ManejoDatos(); Resolucion resol = new Resolucion(); resol.Ubicacion = ruta; resol.Editables = editables; resol.Datos = datos; resol.Codigo = resolucion; resol.Plantilla = plantilla; // resol.IDConsejo = 20; // resol.IDConsejo =Convert.ToInt32( txtCodigoConsejoDestino.Text); resol.IDConsejo = txtCodigoConsejoDestino.Text; resol.Estudiante = txtCedula.Text; resol.Secretaria = ((UsuariosSW)Session["USUARIOSW"]).Cedula; bool verificado = mysql.verificarDatos(editables, datos); if (verificado) { bool guardado = mysql.guardarResolucion(resol); if (guardado) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Resolucion creada !')", true); // Label2.Text = "Documento Generado y Guardado"; } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Se ha producido un error en los datos')", true); // Label2.Text = "Ha ocurrido un error en los datos"; } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Llenar TODOS los campos correctamente')", true); } }