protected void Button1_Click(object sender, EventArgs e) { decimal idregistrado = PERSONASCER.PERSONASCERRegistrar(0, "1095808196", "gabriel", "ortega", DateTime.Now, "*****@*****.**", "6381746", "300777777", "per", "soltero", 0, DateTime.Now, 0, DateTime.Now, "EMPLEADO", "ADMINISTRACION", "CONTROL", "2000000", "SI"); GeneradorPdf.generarCertificado("1095808196", "", "PRUEBA1.docx", "PLANTILLACERTIFICACION.docx", "CERTIFICADO", 0); }
protected void CreateUser_Click(object sender, EventArgs e) { List <DCPERSONASCER> lstPERSONASCER = new List <DCPERSONASCER>(); //DataTable DTPERSONASCER = new DataTable(); //DTPERSONASCER = PERSONASCER.PERSONASCERObtenerbyCriterio(txtIdentificacion.Text, 0); lstPERSONASCER = PERSONASCER.PERSONASCERObtenerbyCriterio(txtIdentificacion.Text, 0); if (lstPERSONASCER.Count > 0) { //mensajeBUG("" + obtenerFecha(txtFechaDeExpedicion.Text).ToString()+" =="+obtenerFecha(DTPERSONASCER.Rows[0]["FECHANACIMIENTO"].ToString()).ToString()+" &&" +DTPERSONASCER.Rows[0]["EMAIL"].ToString()+"=="+ txtEmai.Text,"1"); DateTime fechaconsulta = Convert.ToDateTime(lstPERSONASCER[0].FECHANACIMIENTO); DateTime fechaconsultaformateada = new DateTime(fechaconsulta.Year, fechaconsulta.Month, fechaconsulta.Day); DateTime fechacalendar = Convert.ToDateTime(txtFechaDeExpedicion.Text); DateTime fechacalendarformateada = new DateTime(fechacalendar.Year, fechacalendar.Month, fechacalendar.Day); mensajeBUG("FECHA1BASE" + fechaconsultaformateada + " FECHA2CALENDAR" + fechacalendarformateada, "2comparaciondefechas"); if (fechaconsultaformateada == fechacalendarformateada && lstPERSONASCER[0].EMAIL.ToString().Equals(txtEmai.Text)) //if (Convert.ToDateTime(txtFechaDeExpedicion.Text) == Convert.ToDateTime(DTPERSONASCER.Rows[0]["FECHANACIMIENTO"]) && DTPERSONASCER.Rows[0]["EMAIL"].ToString() == txtEmai.Text) { String nombresinencriptar = DateTime.Now.Millisecond.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.ToString() + txtNombres.Text; String nuevonombre = Encriptar(nombresinencriptar) + ".docx"; String nuevonombrepdf = Encriptar(nombresinencriptar) + ".pdf"; mensajeBUG("pdf" + nuevonombrepdf, "3encriptacion"); GeneradorPdf.generarCertificado(txtIdentificacion.Text, "SI", nuevonombre, "PLANTILLACERTIFICACION.docx", "CERTIFICADO", 0); mensajeBUG("ok generacion", "4generado"); String url = ConfigurationManager.AppSettings["Rutaserver"] + ConfigurationManager.AppSettings["RutaDescargas"] + nuevonombrepdf; Uri pruebapdfuri = new Uri(url); mensajeBUG("url", "5url"); HttpContext.Current.Response.Write("<script>window.open ('" + pruebapdfuri + "','" + pruebapdfuri + "')</script>"); mensajeBUG("urlventana", "6urlventana"); HttpContext.Current.Response.Write("<script>alert('Se ha generado el Certificado satisfactoriamente y fue enviado a su correo!');</script>"); //MessageBox.Show("Se ha generado el Certificado satisfactoriamente!"); } else { HttpContext.Current.Response.Write("<script>alert('Los valores no concuerdan!');</script>"); //MessageBox.Show("Los valores no concuerdan!"); } } else { } }
protected void CreateUser_Click(object sender, EventArgs e) { List <DCPERSONASCER> lstPERSONASCER = new List <DCPERSONASCER>(); List <DCPERSONASCER> DTPERSONASCER = new List <DCPERSONASCER>(); DTPERSONASCER = PERSONASCER.PERSONASCERObtenerbyCriterio(txtIdentificacion.Text, 0); if (DTPERSONASCER.Count == 0) { PERSONASCER.PERSONASCERRegistrar(0, txtIdentificacion.Text.ToUpper(), txtNombres.Text.ToUpper(), txtApellidos.Text.ToUpper(), new DateTime(2002, 11, 3), txtEmail.Text, txtTelefono.Text.ToUpper(), txtMovil.Text.ToUpper(), "EMPLEADO", "SOLTERO", 0, DateTime.Now, 0, DateTime.Now, txtCargo.Text.ToUpper(), txtDependencia.Text.ToUpper(), txtFunciones.Text.ToUpper(), txtSueldo.Text.ToUpper(), "SI"); CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta en la BD, los datos de la persona", "sucessful", this, GetType()); } else { CARGARGRILLA(); Alerta.notiffy("Operacion incompleta", "No se ha podido agregar la persona, el numero de identificación ya existe!", "warning", this, GetType()); } }
public void CARGARGRILLA() { List <DCPERSONASCER> dt = new List <DCPERSONASCER>(); dt = PERSONASCER.PERSONASCERObtener(0); grdLista.Visible = false; if (dt.Count > 0) { grdLista.Visible = true; grdLista.DataSource = null; grdLista.DataBind(); grdLista.DataSource = dt; grdLista.DataBind(); } else { grdLista.Visible = false; grdLista.DataSource = null; grdLista.DataBind(); } }
public void CARGARGRILLA3() { List <DCPERSONASCER> dt = new List <DCPERSONASCER>(); dt = PERSONASCER.PERSONASCERObtener(0); GridView1.Visible = false; if (dt.Count > 0) { GridView1.Visible = true; GridView1.DataSource = null; GridView1.DataBind(); GridView1.DataSource = dt; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = null; GridView1.DataBind(); } }
protected void grdLista_RowUpdating(object sender, GridViewUpdateEventArgs e) { var idpersona = grdLista.DataKeys[e.RowIndex].Value; TextBox txtnombres = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtNOMBRES"); TextBox txtapellidos = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtAPELLIDOS"); TextBox txtidentificacion = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtIDENTIFICACION"); TextBox txtemail = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtEMAIL"); TextBox txtcargo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtCARGO"); TextBox txtdependencia = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtDEPENDENCIA"); TextBox txtfunciones = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtFUNCIONES"); TextBox txtsueldo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtSUELDO"); //TextBox txtactivo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtACTIVO"); DropDownList Drpactivo = (DropDownList)grdLista.Rows[e.RowIndex].FindControl("DrpACTIVO"); //String txtnombres = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtNOMBRES"); //String txtapellidos = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtAPELLIDOS"); //String txtidentificacion = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtIDENTIFICACION"); //String txtemail = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtEMAIL"); //String txtcargo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtCARGO"); //String txtdependencia = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtDEPENDENCIA"); //String txtfunciones = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtFUNCIONES"); //String txtsueldo = (TextBox)grdLista.Rows[e.RowIndex].FindControl("txtSUELDO"); if (txtnombres.Text != "" && txtapellidos.Text != "" && txtidentificacion.Text != "" && txtemail.Text != "" && txtcargo.Text != "" && txtdependencia.Text != "" && txtfunciones.Text != "" && txtsueldo.Text != "" && Drpactivo.SelectedItem.ToString() != "") { if (PERSONASCER.PERSONASCERActualizarbyIDPERSONA(Convert.ToDecimal(idpersona), txtidentificacion.Text, txtnombres.Text, txtapellidos.Text, DateTime.Now, txtemail.Text, "", "", "", "", 0, DateTime.Now, 0, DateTime.Now, txtcargo.Text, txtdependencia.Text, txtfunciones.Text, txtsueldo.Text, Drpactivo.SelectedItem.ToString())) { grdLista.EditIndex = -1; CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta la actualización de los datos", "sucessful", this, GetType()); } else { Alerta.notiffy("Operacion incompleta", "No se han podido actualizar los cambios!", "warning", this, GetType()); return; } } }
protected void BTNMODALGUARDAR_Click(object sender, EventArgs e) { PERSONACERSELECCIONADA = (List <DCPERSONASCER>)Session["PERSONACERSELECCIONADA"]; if (PERSONASCER.PERSONASCERActualizarbyIDPERSONA(PERSONACERSELECCIONADA[0].IDPERSONA, txt_IDENTIFICACION.Text, txt_NOMBRES.Text, txt_APELLIDOS.Text, DateTime.Now, txt_EMAIL.Text, txt_TELEFONO.Text, txt_MOVIL.Text, "PRUEBA", "SOLTERO", 0, DateTime.Now, 0, DateTime.Now, txt_CARGO.Text, txt_DEPENDENCIA.Text, txt_FUNCIONES.Text, txt_SUELDO.Text, "SI")) { //grdLista.EditIndex = -1; //CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta la actualización de los datos", "sucessful", this, GetType()); } else { Alerta.notiffy("Operacion incompleta", "No se han podido actualizar los cambios!", "warning", this, GetType()); } CARGARGRILLA3(); //List<DCPERSONAS> lstPERSONAS = new List<DCPERSONAS>(); //DataTable DTPERSONAS = new DataTable(); //DTPERSONAS = PERSONAS.PERSONASObtenerbyCriterio(txt_NumeroId.Text, 0); //if (DTPERSONAS.Rows.Count == 0) //{ // PERSONAS.PERSONASRegistrar(0, txt_NumeroId.Text, // cbo_tipoId.SelectedItem.Text, Convert.ToDateTime(dtpFechaExpedicion.Text), Convert.ToDateTime(dtpFechaNacimiento.Text), // txt_nombres.Text.ToUpper(), txt_apellidos.Text.ToUpper(), txtDireccion.Text, cboPais.SelectedItem.Text, // cboDepto.SelectedItem.Text, cboCiudad.SelectedItem.Text, TextCorreoElectronico.Text, cboGenero.SelectedItem.Text, // txtTelefono.Text, txtCelular.Text, "PERSONA", "SI", 0, DateTime.Now, 0, DateTime.Now); // //string script = " $.growl.notice({ title: 'Registro Exitoso',message: '' });"; // //ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true); // Alerta.notiffy("Registro Exitoso", "Se ha registrado correctamenta en la BD, los datos de la persona", "sucessful", this, GetType()); //} //else //{ // //string script = "alert(\"No se ha podido agregar la persona pues el numero de identificación ya existe!\");"; // //ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true); // Alerta.notiffy("Operacion incompleta", "No se ha podido agregar la persona, el numero de identificación ya existe!", "warning", this, GetType()); //} }
public void grdLista_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = grdLista.Rows[index]; //decimal IDUSUARIOSELECCIONADODELAGRILLA = Convert.ToDecimal(grdLista.Rows[index].Cells[2].Text); var idpersona = grdLista.DataKeys[index].Value; decimal IDUSUARIOSELECCIONADODELAGRILLA = Convert.ToDecimal(idpersona); bool _actualizado; _actualizado = PERSONASCER.PERSONASCEREliminarbyIDPERSONA(IDUSUARIOSELECCIONADODELAGRILLA, 0, DateTime.Now); if (_actualizado == true) { CARGARGRILLA(); Alerta.notiffy("Registro Exitoso", "Se ha eliminado correctamente la persona", "sucessful", this, GetType()); } else { Alerta.notiffy("Registro Exitoso", "Se ha eliminado correctamente la persona", "warning", this, GetType()); } } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Editar")) { int index = Convert.ToInt32(e.CommandArgument); string code = GridView1.DataKeys[index].Value.ToString(); PERSONACERSELECCIONADA = PERSONASCER.PERSONASCERObtenerbyIDPERSONA(Convert.ToDecimal(code), 0); Session["PERSONACERSELECCIONADA"] = PERSONACERSELECCIONADA; txt_APELLIDOS.Text = PERSONACERSELECCIONADA[0].APELLIDOS; txt_CARGO.Text = PERSONACERSELECCIONADA[0].CARGO; txt_DEPENDENCIA.Text = PERSONACERSELECCIONADA[0].DEPENDENCIA; txt_EMAIL.Text = PERSONACERSELECCIONADA[0].EMAIL; txt_FUNCIONES.Text = PERSONACERSELECCIONADA[0].FUNCIONES; txt_IDENTIFICACION.Text = PERSONACERSELECCIONADA[0].IDENTIFICACION; txt_MOVIL.Text = PERSONACERSELECCIONADA[0].MOVIL; txt_NOMBRES.Text = PERSONACERSELECCIONADA[0].NOMBRE; txt_SUELDO.Text = PERSONACERSELECCIONADA[0].SUELDO; txt_TELEFONO.Text = PERSONACERSELECCIONADA[0].TELEFONO; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"<script type='text/javascript'>"); sb.Append("$('#myModal').modal('show');"); sb.Append(@"</script>"); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModalScript", sb.ToString(), false); } else if (e.CommandName.Equals("Eliminar")) { int index = Convert.ToInt32(e.CommandArgument); Decimal code = Convert.ToDecimal(GridView1.DataKeys[index].Value); bool _actualizado; _actualizado = PERSONASCER.PERSONASCEREliminarbyIDPERSONA(code, 0, DateTime.Now); if (_actualizado == true) { CARGARGRILLA(); CARGARGRILLA2(); CARGARGRILLA3(); Alerta.notiffy("Eliminación Exitosa", "Se ha Eliminado correctamente la persona", "sucessful", this, GetType()); } else { Alerta.notiffy("Operacion incompleta", "No se ha podido Eliminar la persona!", "warning", this, GetType()); } //DataTable dt = new DataTable(); //dt = PERSONASCER.PERSONASCERObtener(0); //DetailsView1.Visible = false; //if (dt.Rows.Count > 0) //{ // DetailsView1.Visible = true; // DetailsView1.DataSource = null; // DetailsView1.DataBind(); // DetailsView1.DataSource = dt; // DetailsView1.DataBind(); //} //else //{ // DetailsView1.Visible = false; // DetailsView1.DataSource = null; // DetailsView1.DataBind(); //} } }