Exemple #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String   tipo           = ddlActividad.SelectedValue;
            DateTime fechaActividad = Convert.ToDateTime(convertirAFechaAmericana(txbFechaActividad.Text));
            String   notas          = txbNotas.Text;

            try
            {
                if (bdTS.actNuevaActividad(S, F, tipo, fechaActividad.ToString("yyyy-MM-dd HH:mm:ss"), U, notas))
                {
                    llenarGdvActividades();
                    prepararPnlNuevoActividad();
                    mst.mostrarMsjNtf(dic.msjSeHaIngresado);
                }
                else
                {
                    if (L.Equals("es"))
                    {
                        mst.mostrarMsjAdvNtf("Una familia solo puede tener una actividad de cada tipo, el mismo dia.");
                    }
                    else
                    {
                        mst.mostrarMsjAdvNtf("A family can only have one activity of each type, the same day.");
                    }
                }
            }
            catch (Exception ex)
            {
                mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
            }
        }
Exemple #2
0
        protected void gdvAñosEscolar_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            gdvAñosEscolar.Columns[0].Visible = true;
            gdvAñosEscolar.Columns[1].Visible = true;
            gdvAñosEscolar.Columns[2].Visible = true;
            int numFilaEsp = Int32.Parse(e.CommandArgument.ToString());

            fechaCreacionSLCT = Convert.ToDateTime(gdvAñosEscolar.Rows[numFilaEsp].Cells[1].Text);
            miembroSLCT       = gdvAñosEscolar.Rows[numFilaEsp].Cells[0].Text;
            añoSLCT           = gdvAñosEscolar.Rows[numFilaEsp].Cells[2].Text;
            if (e.CommandName == "cmdActualizar")
            {
                try
                {
                    DataRow dtRow   = bdTS.añoObtenerAñoEscolarEsp(S, miembroSLCT, añoSLCT + "", fechaCreacionSLCT.ToString("yyyy-MM-dd HH:mm:ss")).Rows[0];
                    String  nombre  = dtRow["Nombre"].ToString();
                    String  año     = dtRow["Año"].ToString();
                    String  grado   = dtRow["Grado"].ToString();
                    String  estado  = dtRow["Estado"].ToString();
                    String  carrera = dtRow["Carrera"].ToString();
                    String  seccion = dtRow["Seccion"].ToString();
                    //String centroEducProximoGrado = dtRow["GradeSchool"].ToString();
                    String notas = dtRow["Notas"].ToString();
                    //lblVActMiembro.Text = gdvAñosEscolar.Rows[numFilaEsp].Cells[3].Text;
                    //lblVActAño.Text = gdvAñosEscolar.Rows[numFilaEsp].Cells[4].Text;
                    //if (notas.Equals(" "))
                    //{
                    //    notas = "";
                    //}
                    //llenarCentrosEduc(ddlActCentroEduc, proximoGrado);
                    //ddlActCentroEduc.SelectedValue = centroEducProximoGrado;
                    ddlActCarreraEduc.SelectedValue  = carrera;
                    ddlActEstadoEduc.SelectedValue   = estado;
                    ddlActProximoGrado.SelectedValue = grado;
                    txbActNotas.Text                = notas;
                    txbActSeccion.Text              = seccion;
                    lblVActMiembro.Text             = "  " + nombre;
                    lblVActAño.Text                 = "  " + año;
                    pnlIngresarAñoEscolar.Visible   = false;
                    pnlActualizarAñoEscolar.Visible = true;
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
            }
            else if (e.CommandName == "cmdEliminar")
            {
                mst.mostrarMsjOpcionesMdl(dic.msjEliminarRegistro);
            }
            gdvAñosEscolar.Columns[0].Visible = false;
            gdvAñosEscolar.Columns[1].Visible = false;
            gdvAñosEscolar.Columns[2].Visible = false;
        }
Exemple #3
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         TS     = ddlTS.SelectedValue;
         region = ddlRegion.SelectedValue;
         llenarGdvFamilias();
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
 protected void iniciarElementos()
 {
     mst = (mast)Master;
     if (!IsPostBack)
     {
         bdTS  = new BDTS();
         bdGEN = new BDGEN();
         BDF   = new BDFamilia();
         F     = mast.F;
         S     = mast.S;
         U     = mast.U;
         L     = mast.L;
         dic   = new Diccionario(L, S);
         llenarElementos();
         if (Session["AsignoTSGrupo"] != null)
         {
             String asigno = (String)Session["AsignoTSGrupo"];
             if (asigno.Equals("SI"))
             {
                 mst.mostrarMsjNtf(dic.msjSeHaActualizado);
             }
             else
             {
                 mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + asigno + ".");
             }
             Session["AsignoTSGrupo"] = null;
         }
     }
 }
Exemple #5
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String   empleado    = ddlTS.SelectedValue;
            DateTime fechaInicio = Convert.ToDateTime(convertirAFechaAmericana(txbFechaInicio.Text));

            try
            {
                if (bdTS.asgTSNuevaAsignacion(S, F, empleado, U, fechaInicio.ToString("yyyy-MM-dd HH:mm:ss.fff")))
                {
                    llenarGdvAsignaciones();
                    mst.mostrarMsjNtf(dic.msjSeHaActualizado);
                    DataTable dt   = BDF.obtenerDatos(S, F, L);
                    DataRow   rowF = dt.Rows[0];
                    lblVTS.Text = rowF["TS"].ToString();
                }
                else
                {
                    if (L.Equals("es"))
                    {
                        mst.mostrarMsjAdvNtf("No es posible asignar a ese Trabajador Social, ya que ya está activo.");
                    }
                    else
                    {
                        mst.mostrarMsjAdvNtf("Is not possible to assign this Social Worker, since is already active.");
                    }
                }
            }
            catch (Exception ex)
            {
                mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
            }
        }
Exemple #6
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     cantMeses   = Int32.Parse(txbCantMeses.Text);
     soloUltimas = 0;
     if ((cantMeses > 0) && (cantMeses < 13))
     {
         try
         {
             buscar();
         }
         catch (Exception ex)
         {
             mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
         }
     }
     else
     {
         if (L.Equals("es"))
         {
             mst.mostrarMsjAdvNtf("La cantidad de Meses Atrás, debe estar entre 1 y 12.");
         }
         else
         {
             mst.mostrarMsjAdvNtf("The number of Months Ago, must be between 1 and 12.");
         }
     }
 }
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         String    TS         = ddlTS.SelectedValue;
         String    estadoTS   = "Activo";
         String    estadoAfil = ddlEstadoAfil.SelectedValue;
         String    area       = ddlArea.SelectedValue;
         String    region     = ddlRegion.SelectedValue;
         String    direccion  = txbDireccion.Text;
         DataTable dtFamilias = bdGEN.obtenerFamiliasBusqueda(S, L, TS, estadoTS, estadoAfil, area, region, direccion);
         if (dtFamilias.Rows.Count != 0)
         {
             llenarGdvFamilias(dtFamilias);
             pnlBusquedaFamilia.Visible = false;
             lblTotal.Text      = "Total: " + dtFamilias.Rows.Count;
             pnlMostrar.Visible = true;
         }
         else
         {
             mst.mostrarMsjAdvNtf(dic.msjNoEncontroResultados);
         }
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
 protected void btnCambiarPref_Click(object sender, EventArgs e)
 {
     try
     {
         String  nSitio   = ddlSitio.SelectedValue;
         Boolean cambiarL = chkIdioma.Checked;
         String  nIdioma  = "";
         if (cambiarL)
         {
             if (L.Equals("es"))
             {
                 nIdioma = "en";
             }
             else
             if (L.Equals("en"))
             {
                 nIdioma = "es";
             }
         }
         else
         {
             nIdioma = L;
         }
         btnCambiarPref.Text = nIdioma;
         BDU.cambiarPreferencias(U, nSitio, nIdioma);
         Response.Redirect("~/MISC/Buscar.aspx");
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Exemple #9
0
        protected void gdvAsistencias_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            gdvAsistencias.Columns[0].Visible = true;
            gdvAsistencias.Columns[1].Visible = true;
            gdvAsistencias.Columns[2].Visible = true;
            gdvAsistencias.Columns[3].Visible = true;
            int numFilaEsp = Int32.Parse(e.CommandArgument.ToString());

            miembroSLCT         = gdvAsistencias.Rows[numFilaEsp].Cells[0].Text;
            fechaAsistenciaSLCT = gdvAsistencias.Rows[numFilaEsp].Cells[1].Text;
            String nombre      = gdvAsistencias.Rows[numFilaEsp].Cells[5].Text;
            String fechaSalida = gdvAsistencias.Rows[numFilaEsp].Cells[2].Text;
            String impresiones = gdvAsistencias.Rows[numFilaEsp].Cells[8].Text;
            String comentarios = gdvAsistencias.Rows[numFilaEsp].Cells[9].Text;

            if (e.CommandName == "cmdActualizar")
            {
                try
                {
                    fechaSalida            = HttpUtility.HtmlDecode(fechaSalida.Replace("&nbsp;", ""));
                    comentarios            = HttpUtility.HtmlDecode(comentarios.Replace("&nbsp;", ""));
                    txbActHoraSalida.Text  = String.IsNullOrEmpty(fechaSalida) ? "" : Convert.ToDateTime(fechaSalida).ToString("HH:mm");
                    chkSalida.Checked      = String.IsNullOrEmpty(fechaSalida) ? false : true;
                    lblVNombre.Text        = nombre;
                    txbActComentarios.Text = comentarios;
                    txbActImpresiones.Text = impresiones;
                    pnlReferencias.Visible = false;
                    mst.mostrarModalYContenido(pnlActualizar);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
            }
            else if (e.CommandName == "cmdEliminar")
            {
                mst.mostrarMsjOpcionesMdl(dic.msjEliminarRegistro);
            }
            gdvAsistencias.Columns[0].Visible = false;
            gdvAsistencias.Columns[1].Visible = false;
            gdvAsistencias.Columns[2].Visible = false;
            gdvAsistencias.Columns[3].Visible = false;
        }
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            String año    = txbAño.Text;
            int    intAño = Int32.Parse(año);

            if ((intAño >= 2002) && (intAño <= DateTime.Now.Year))
            {
                String    filCarrera       = ddlCarrera.SelectedValue;
                String    filCentroEduc    = ddlCentroEduc.SelectedValue;
                String    filEstadoEduc    = ddlEstadoEduc.SelectedValue;
                String    filExcEstadoEduc = ddlExcEstdoEduc.SelectedValue;
                String    filGrado         = ddlGrado.SelectedValue;
                String    filMaestro       = ddlMaestro.SelectedValue;
                String    filNivelEduc     = ddlNivelEduc.SelectedValue;
                String    filPueblo        = ddlPueblo.SelectedValue;
                String    filTipoAfil      = ddlTipoAfil.SelectedValue;
                String    filTipoEscuela   = ddlTipoEscuela.SelectedValue;
                Boolean   apad             = chkApad.Checked;
                Boolean   grad             = chkGrad.Checked;
                Boolean   desaf            = chkGrad.Checked;
                DataTable dtMiembros       = bdGEN.obtenerMiembrosInfoEduc(S, L, año, filCarrera, filCentroEduc, filEstadoEduc, filExcEstadoEduc, filGrado, filMaestro, filNivelEduc, filPueblo, filTipoAfil, filTipoEscuela, apad, grad, desaf);
                if (dtMiembros.Rows.Count != 0)
                {
                    try
                    {
                        llenarGdvMiembrosInfoEduc(dtMiembros);
                        pnlBusquedaMiembrosInfoEduc.Visible = false;
                        lblTotal.Text      = "Total: " + dtMiembros.Rows.Count;
                        pnlMostrar.Visible = true;
                    }
                    catch (Exception ex)
                    {
                        mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                    }
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroResultados);
                }
            }
            else
            {
                if (L.Equals("es"))
                {
                    mst.mostrarMsjAdvNtf("El Año para Información Educativa, debe ser entre 2002 y el año actual.");
                }
                else
                {
                    mst.mostrarMsjAdvNtf("The year for Educational Information, must be between 2002 and the current year.");
                }
            }
        }
Exemple #11
0
 protected void lnkFamiliasTS_Click(object sender, EventArgs e)
 {
     ocultarPestañas();
     visibilizarPestaña(pnlFamiliasTS, lnkFamiliasTS);
     try
     {
         fmlLlenarFormFamiliasTS();
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Exemple #12
0
 protected void eliminarAsistencia(object sender, EventArgs e)
 {
     try
     {
         bdPROE.recuperarEstadoReferencia(S, miembroSLCT, tipoActividad, U);
         bdPROE.ingresarHistorico(S, miembroSLCT, fechaAsistenciaSLCT, tipoActividad, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), U);
         llenarGdvReferencias();
         mst.mostrarMsjNtf(dic.msjSeHaEliminado);
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Exemple #13
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         gdvMiembros.Columns[0].Visible = true;
         gdvMiembros.Columns[1].Visible = true;
         gdvMiembros.Columns[2].Visible = true;
         foreach (GridViewRow row in gdvMiembros.Rows)
         {
             CheckBox check         = row.FindControl("chkAplica") as CheckBox;
             String   idMiembro     = row.Cells[0].Text;
             String   fechaCreacion = row.Cells[1].Text;
             String   fechaInicio   = row.Cells[2].Text;
             if (!fechaCreacion.Equals("&nbsp;"))
             {
                 fechaCreacion = Convert.ToDateTime(fechaCreacion).ToString("yyyy-MM-dd HH:mm:ss");
                 fechaInicio   = Convert.ToDateTime(fechaInicio).ToString("yyyy-MM-dd HH:mm:ss");
             }
             else
             {
                 fechaCreacion = "";
                 fechaInicio   = "";
             }
             if (check.Checked)
             {
                 if (!bdTS.NADFASVerificarNADFASActivo(S, idMiembro, año))
                 {
                     bdTS.NADFASNuevoNADFAS(S, idMiembro, año, U);
                 }
             }
             else
             {
                 if (bdTS.NADFASVerificarNADFASActivo(S, idMiembro, año))
                 {
                     bdTS.NADFASDesactivarNADFAS(S, idMiembro, fechaCreacion, año, U, fechaInicio);
                 }
             }
         }
         llenarGdvMiembros();
         gdvMiembros.Columns[0].Visible = false;
         gdvMiembros.Columns[1].Visible = false;
         gdvMiembros.Columns[2].Visible = false;
         mst.mostrarMsjNtf(dic.msjSeHaActualizado);
     }catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Exemple #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     mst = (mast)Master;
     mst.contentCallEvent += new EventHandler(eliminarAnalisis);
     if (!IsPostBack)
     {
         try
         {
             bdTS         = new BDTS();
             bdGEN        = new BDGEN();
             BDF          = new BDFamilia();
             F            = mast.F;
             S            = mast.S;
             U            = mast.U;
             L            = mast.L;
             dic          = new Diccionario(L, S);
             postAnalisis = false;
             llenarElementos();
             if (!String.IsNullOrEmpty(F))
             {
                 try
                 {
                     familia = F;
                     llenarPnlRegistroAnalisis();
                     pnlAsignarClasif.Visible = true;
                     pnlFamilias.Visible      = false;
                 }
                 catch (Exception ex)
                 {
                     mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.ToString() + ".");
                 }
             }
         }
         catch
         {
         }
     }
 }
Exemple #15
0
 protected void llenarElementos()
 {
     llenarFormInsertarAviso();
     llenarGdvAvisos();
     txbNota.MaxLength = 100;
     try
     {
         txbNota.Text = bdTS.avsObtenerNota(S, F);
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.ToString() + ".");
     }
     lnkNotaLibre.Text   = dic.notaLibre;
     lnkOpciones.Text    = dic.predeterminados;
     lblNota.Text        = dic.nota + ":";
     btnGuardarNota.Text = dic.actualizar;
 }
 protected void gvhistorial_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     gdvHistorialViveres.Columns[0].Visible = true;
     gdvHistorialViveres.Columns[1].Visible = true;
     gdvHistorialViveres.Columns[2].Visible = true;
     gdvHistorialViveres.Columns[3].Visible = true;
     gdvHistorialViveres.Columns[4].Visible = true;
     gdvHistorialViveres.Columns[5].Visible = true;
     if (e.CommandName == "cmdActualizar")
     {
         try
         {
             pnlRegistro.Visible   = true;
             fechaAutorizacionSLCT = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text;
             razonSLCT             = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text;
             String fechaEntrega1 = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[2].Text;
             String fechaEntrega2 = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[3].Text;
             String fechaEntrega3 = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[4].Text;
             String fechaEntrega4 = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[5].Text;
             lblVFechaAutorizacion.Text = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[9].Text;
             lblVRazon.Text             = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[6].Text;
             lblVFrecuencia.Text        = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[8].Text;
             lblVNotas.Text             = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[11].Text;
             fechaEntrega1 = HttpUtility.HtmlDecode(fechaEntrega1.Replace("&nbsp;", ""));
             fechaEntrega2 = HttpUtility.HtmlDecode(fechaEntrega2.Replace("&nbsp;", ""));
             fechaEntrega3 = HttpUtility.HtmlDecode(fechaEntrega3.Replace("&nbsp;", ""));
             fechaEntrega4 = HttpUtility.HtmlDecode(fechaEntrega4.Replace("&nbsp;", ""));
             hizoEntrega1  = !String.IsNullOrEmpty(fechaEntrega1) ? true : false;
             hizoEntrega2  = !String.IsNullOrEmpty(fechaEntrega2) ? true : false;
             hizoEntrega3  = !String.IsNullOrEmpty(fechaEntrega3) ? true : false;
             hizoEntrega4  = !String.IsNullOrEmpty(fechaEntrega4) ? true : false;
             String          sql = "SELECT Quantity, Frecuency, Notes FROM dbo.FamilyHelp WHERE RecordStatus = ' ' AND Project = '" + S + "' AND FamilyId = '" + F + "' AND Reason = '" + razonSLCT + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fechaAutorizacionSLCT + "'";
             SqlDataAdapter  daUser;
             DataTableReader adap;
             DataTable       tableData = new DataTable();
             con.Open();
             daUser = new SqlDataAdapter(sql, ConnectionString);
             daUser.Fill(tableData);
             adap = new DataTableReader(tableData);
             con.Close();
             cantidadSLCT         = tableData.Rows[0]["Quantity"].ToString();
             frecuenciaSLCT       = tableData.Rows[0]["Frecuency"].ToString();
             notasSLCT            = tableData.Rows[0]["Notes"].ToString();
             chkEntrega1.Checked  = hizoEntrega1;
             chkEntrega2.Checked  = hizoEntrega2;
             chkEntrega3.Checked  = hizoEntrega3;
             chkEntrega4.Checked  = hizoEntrega4;
             chkEntrega1.Visible  = lblEntrega1.Visible = Int32.Parse(cantidadSLCT) >= 1 ? true : false;
             chkEntrega2.Visible  = lblEntrega2.Visible = Int32.Parse(cantidadSLCT) >= 2 ? true : false;
             chkEntrega3.Visible  = lblEntrega3.Visible = Int32.Parse(cantidadSLCT) >= 3 ? true : false;
             chkEntrega4.Visible  = lblEntrega4.Visible = Int32.Parse(cantidadSLCT) >= 4 ? true : false;
             btnmodificar.Visible = true;
         }
         catch (Exception ex)
         {
             mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
         }
     }
     gdvHistorialViveres.Columns[0].Visible = false;
     gdvHistorialViveres.Columns[1].Visible = false;
     gdvHistorialViveres.Columns[2].Visible = false;
     gdvHistorialViveres.Columns[3].Visible = false;
     gdvHistorialViveres.Columns[4].Visible = false;
     gdvHistorialViveres.Columns[5].Visible = false;
 }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            int contadorCondiciones = 0;
            int contadorCampos      = 1;

            gdvCondiciones.Columns[0].Visible = true;
            String camposCondiciones  = "";
            String valoresCondiciones = "";

            foreach (GridViewRow row in gdvCondiciones.Rows)
            {
                CheckBox check     = row.FindControl("chkAplica") as CheckBox;
                String   condicion = row.Cells[0].Text;
                int      aplica    = 0;
                if (check.Checked)
                {
                    aplica = 1;
                    contadorCondiciones++;
                }
                camposCondiciones  = camposCondiciones + "Condition" + contadorCampos + ", PointsC" + contadorCampos + ", ";
                valoresCondiciones = valoresCondiciones + "'" + condicion + "', " + aplica + ", ";
                contadorCampos++;
            }
            camposCondiciones  = camposCondiciones.Substring(0, camposCondiciones.Length - 2);
            valoresCondiciones = valoresCondiciones.Substring(0, valoresCondiciones.Length - 2);
            gdvCondiciones.Columns[0].Visible = false;
            if (contadorCondiciones > 0)
            {
                String clasificacion = "";
                if ((contadorCondiciones == 1) || (contadorCondiciones == 2))
                {
                    clasificacion = "C";
                }
                else if ((contadorCondiciones == 3) || (contadorCondiciones == 4))
                {
                    clasificacion = "B";
                }
                else if (contadorCondiciones >= 5)
                {
                    clasificacion = "A";
                }
                String añoClasificacion = (DateTime.Now.Year + 1) + "";
                try
                {
                    bdTS.clsIngresarClasificacion(S, familia, clasificacion, añoClasificacion, U, "0", camposCondiciones, valoresCondiciones);
                    //bdTS.clsCambiarSiguienteClasificacion(S, F, U, clasificacion);
                    if (String.IsNullOrEmpty(clasifSigAño))
                    {
                        mst.mostrarMsjNtf(dic.msjSeHaIngresado);
                    }
                    else
                    {
                        mst.mostrarMsjNtf(dic.msjSeHaActualizado);
                    }
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
                pnlAsignarClasif.Visible = false;
                pnlFamilias.Visible      = true;
                llenarGdvFamilias();
            }
            else
            {
                if (L.Equals("es"))
                {
                    mst.mostrarMsjAdvNtf("Debe al menos seleccionar una condición.");
                }
                else
                {
                    mst.mostrarMsjAdvNtf("You must at least select one condition.");
                }
            }
        }
Exemple #18
0
 protected void gdvVisitas_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     fechaVisitaSLCT   = Convert.ToDateTime(gdvVisitas.Rows[Int32.Parse(e.CommandArgument.ToString())].Cells[1].Text);
     fechaCreacionSLCT = Convert.ToDateTime(gdvVisitas.Rows[Int32.Parse(e.CommandArgument.ToString())].Cells[5].Text);
     tipo = gdvVisitas.Rows[Int32.Parse(e.CommandArgument.ToString())].Cells[4].Text;
     if (e.CommandName == "cmdSeleccionar")
     {
         try
         {
             actualizar = true;
             int       numFilaEsp = 0;
             DataTable vstEsp     = bdTS.vstObtenerVisitaEspecifica(S, F, L, tipo, fechaVisitaSLCT.ToString("yyyy-MM-dd HH:mm:ss.fff"), fechaCreacionSLCT.ToString("yyyy-MM-dd HH:mm:ss.fff"));
             ddlVTipoV.SelectedValue = vstEsp.Rows[numFilaEsp]["VisitType"].ToString();
             ddlVTipoV.Enabled       = false;
             ddlVTipoV.CssClass      = "comboBoxBlueForm";
             lblVTipoV.Visible       = true;
             lblVTipoV.Text          = ddlVTipoV.SelectedItem + "";
             ddlVTipoV.Visible       = false;
             lblVFVisita.Visible     = true;
             lblVFVisita.Text        = vstEsp.Rows[numFilaEsp]["fechaVisita"].ToString();
             txbFVisita.Text         = fechaVisitaSLCT.ToString("dd/MM/yyyy");
             txbFVisita.Enabled      = false;
             txbFVisita.CssClass     = "textBoxBlueForm  date";
             txbFVisita.Visible      = false;
             chkAlcoh.Checked        = (Boolean)vstEsp.Rows[numFilaEsp]["F1V"];
             chkDroga.Checked        = (Boolean)vstEsp.Rows[numFilaEsp]["F2V"];
             chkEcon.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["F3V"];
             chkVIF.Checked          = (Boolean)vstEsp.Rows[numFilaEsp]["F4V"];
             txbFam.Text             = vstEsp.Rows[numFilaEsp]["F"].ToString();
             chkCron.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["S1V"];
             chkEmoc.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["S2V"];
             chkEnf.Checked          = (Boolean)vstEsp.Rows[numFilaEsp]["S3V"];
             txbSalud.Text           = vstEsp.Rows[numFilaEsp]["S"].ToString();
             chkDeser.Checked        = (Boolean)vstEsp.Rows[numFilaEsp]["E1V"];
             chkProb.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["E2V"];
             chkRend.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["E3V"];
             chkRepi.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["E4V"];
             txbEduc.Text            = vstEsp.Rows[numFilaEsp]["E"].ToString();
             chkAnt.Checked          = (Boolean)vstEsp.Rows[numFilaEsp]["L1V"];
             chkDivo.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["L2V"];
             chkDPI.Checked          = (Boolean)vstEsp.Rows[numFilaEsp]["L3V"];
             chkEsc.Checked          = (Boolean)vstEsp.Rows[numFilaEsp]["L4V"];
             chkPens.Checked         = (Boolean)vstEsp.Rows[numFilaEsp]["L5V"];
             txbLeg.Text             = vstEsp.Rows[numFilaEsp]["L"].ToString();
             txbVnd.Text             = vstEsp.Rows[numFilaEsp]["V"].ToString();
             idVisitaSLCT            = vstEsp.Rows[numFilaEsp]["FamilyVisitId"].ToString();
             btnGuardar.Text         = dic.actualizar;
             btnNuevaVst.Visible     = true;
             btnEliminar.Visible     = true;
             llenarGdvObjetivos();
             lblFVisita.Text = dic.TSfechaVisita + ":";
             lblTipoV.Text   = dic.TStipoVisita + ":";
             if (vista)
             {
                 seleccionarConSeguridad();
             }
         }
         catch (Exception ex)
         {
             mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
         }
         //gdvVisitas.Rows[Int32.Parse(e.CommandArgument.ToString())].BackColor = Color.Red;
         //int index = Int32.Parse(e.CommandArgument.ToString());
         //GridViewRow deletedRow = gdvVisitas.Rows[index];
         //deletedRow.BackColor = Color.Red;
     }
     //else if (e.CommandName == "cmdBorrar")
     //{
     //    bdTS.vstEliminar(S, F, tipo, fechaVisita.ToString("yyyy-MM-dd HH:mm:ss.fff"), fechaCreacion.ToString("yyyy-MM-dd HH:mm:ss.fff"));
     //    llenarGdv();
     //}
 }
Exemple #19
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         nombres     = txbNombres.Text;
         apellidos   = txbApell.Text;
         nombreUsual = txbNombreUsual.Text;
         dia         = txbDia.Text;
         if (!String.IsNullOrEmpty(dia))
         {
             dia = Int32.Parse(dia.ToString()) + "";
         }
         mes = ddlMes.SelectedValue;
         if (!String.IsNullOrEmpty(mes))
         {
             mes = Int32.Parse(ddlMes.SelectedValue) + "";
         }
         año = txbAño.Text;
         if (!String.IsNullOrEmpty(año))
         {
             año = Int32.Parse(año.ToString()) + "";
         }
         añoEduc                         = txbAñoEscolar.Text;
         area                            = ddlArea.SelectedValue;
         TS                              = ddlTS.SelectedValue;
         tipoAfil                        = ddlTipoAfil.SelectedValue;
         afil                            = chkAfil.Checked;
         apad                            = chkApad.Checked;
         otros                           = chkOtros.Checked;
         grad                            = chkGrad.Checked;
         gradMiembro                     = chkParienG.Checked;
         desaf                           = chkDesaf.Checked;
         desafMiembro                    = chkParienD.Checked;
         incluirInfoEduc                 = rdbIncluirInfoEduc.Checked;
         emp                             = chkEmp.Checked;
         famEmp                          = chkFamEmp.Checked;
         gdvMiembrosOtraInfo.Visible     = false;
         gdvMiembrosOtraInfoEduc.Visible = false;
         DataTable dtMiembros;
         if (!incluirInfoEduc)
         {
             if (!S.Equals("E") && !S.Equals("A"))
             {
                 dtMiembros = bdGEN.obtenerMiembrosOtraInfo(S, L, nombres, apellidos, dia, mes, año, nombreUsual, area, TS, tipoAfil, incluirInfoEduc, añoEduc, apad, afil, otros, desaf, desafMiembro, grad, gradMiembro);
                 llenarGdvMiembrosOtraInfo(dtMiembros);
                 tipoBusqueda = 1;
             }
             else
             {
                 dtMiembros = bdGEN.obtenerMiembrosOtraInfoEmp(S, L, nombres, apellidos, dia, mes, año, nombreUsual, emp, famEmp);
                 llenarGdvMiembrosOtraInfoEmp(dtMiembros);
                 tipoBusqueda = 2;
             }
             if (dtMiembros.Rows.Count != 0)
             {
                 lblTotal.Text = "Total: " + dtMiembros.Rows.Count;
                 pnlBusquedaMiembrosOtraInfo.Visible = false;
                 pnlMostrar.Visible = true;
             }
             else
             {
                 mst.mostrarMsjAdvNtf(dic.msjNoEncontroResultados);
             }
         }
         else
         {
             if (!String.IsNullOrEmpty(añoEduc))
             {
                 int intAñoEduc = Int32.Parse(añoEduc);
                 if ((intAñoEduc >= 2002) && (intAñoEduc <= DateTime.Now.Year))
                 {
                     dtMiembros = bdGEN.obtenerMiembrosOtraInfo(S, L, nombres, apellidos, dia, mes, año, nombreUsual, area, TS, tipoAfil, incluirInfoEduc, añoEduc, apad, afil, otros, desaf, desafMiembro, grad, gradMiembro);
                     llenarGdvMiembrosOtraInfoEduc(dtMiembros);
                     tipoBusqueda = 3;
                     if (dtMiembros.Rows.Count != 0)
                     {
                         lblTotal.Text = "Total: " + dtMiembros.Rows.Count;
                         pnlBusquedaMiembrosOtraInfo.Visible = false;
                         pnlMostrar.Visible = true;
                     }
                     else
                     {
                         mst.mostrarMsjAdvNtf(dic.msjNoEncontroResultados);
                     }
                 }
                 else
                 {
                     if (L.Equals("es"))
                     {
                         mst.mostrarMsjAdvNtf("El Año para Información Educativa, debe ser entre 2002 y el año actual.");
                     }
                     else
                     {
                         mst.mostrarMsjAdvNtf("The year for Educational Information, must be between 2002 and the current year.");
                     }
                 }
             }
             else
             {
                 if (L.Equals("es"))
                 {
                     mst.mostrarMsjAdvNtf("Por favor, ingrese el Año para Información Educativa.");
                 }
                 else
                 {
                     mst.mostrarMsjAdvNtf("Please, enter the Year for Educational Information.");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Exemple #20
0
        protected void gvhistorial_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            gdvHistorialViveres.Columns[0].Visible = true;
            gdvHistorialViveres.Columns[1].Visible = true;
            if (e.CommandName == "cmdActualizar")
            {
                try
                {
                    btncancelar.Visible   = true;
                    ddlrazon.Enabled      = true;
                    lblVRazon.Visible     = true;
                    fechaAutorizacionSLCT = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text;
                    razonSLCT             = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text;
                    String          notas;
                    String          cantidad;
                    String          frecuencia;
                    String          sql = "SELECT Quantity, Frecuency, Notes FROM dbo.FamilyHelp WHERE RecordStatus = ' ' AND Project = '" + S + "' AND FamilyId = '" + F + "' AND Reason = '" + razonSLCT + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fechaAutorizacionSLCT + "'";
                    SqlDataAdapter  daUser;
                    DataTableReader adap;
                    DataTable       tableData = new DataTable();


                    con.Open();
                    daUser = new SqlDataAdapter(sql, ConnectionString);
                    daUser.Fill(tableData);
                    adap = new DataTableReader(tableData);
                    con.Close();
                    cantidad                    = tableData.Rows[0]["Quantity"].ToString();
                    frecuencia                  = tableData.Rows[0]["Frecuency"].ToString();
                    notas                       = tableData.Rows[0]["Notes"].ToString();
                    ddlrazon.SelectedValue      = razonSLCT;
                    ddlCantidad.SelectedValue   = cantidad;
                    ddlFrecuencia.SelectedValue = frecuencia;
                    lblVRazon.Text              = "&nbsp;&nbsp;" + ddlrazon.SelectedItem;
                    txtnotas.Text               = notas;
                    ddlrazon.Enabled            = false;
                    btnmodificar.Visible        = true;
                    btnaceptar.Visible          = false;
                    //ddlrazon.ValidationGroup = "grpActualizar";
                    ddlrazon.Visible = false;
                    lblrazon.Text    = "&nbsp;" + dic.razon + ":";
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
            }
            else
            if (e.CommandName == "cmdEliminar")
            {
                try
                {
                    ddlrazon.Enabled      = true;
                    fechaAutorizacionSLCT = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text;
                    razonSLCT             = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text;
                    //string notas = gdvHistorialViveres.Rows[Convert.ToInt32(e.CommandArgument)].Cells[3].Text;
                    //string sql = "SELECT Reason, Quantity FROM dbo.FamilyHelp WHERE RecordStatus = ' ' AND Project = '" + S + "' AND FamilyId = '" + F + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fecha + "'";

                    //SqlDataAdapter daUser;
                    //DataTableReader adap;
                    //DataTable tableData = new DataTable();


                    //con.Open();
                    //daUser = new SqlDataAdapter(sql, ConnectionString);
                    //daUser.Fill(tableData);
                    //adap = new DataTableReader(tableData);
                    //con.Close();
                    //string razon = tableData.Rows[0]["Reason"].ToString();
                    //string cantidad = tableData.Rows[0]["Quantity"].ToString();
                    //ddlrazon.SelectedValue = razon;
                    //txtnotas.Text = HttpUtility.HtmlDecode(notas.Replace("&nbsp;", "")); ;
                    //ddlrazon.Enabled = false;
                    //btnmodificar.Visible = true;
                    //btnaceptar.Visible = false;
                    mst.mostrarMsjOpcionesMdl(dic.msjEliminarRegistro);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
            }
            gdvHistorialViveres.Columns[0].Visible = false;
            gdvHistorialViveres.Columns[1].Visible = false;
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            int contadorCondiciones = 0;
            int contadorCampos      = 1;

            gdvCondiciones.Columns[0].Visible = true;
            String camposCondiciones  = "";
            String valoresCondiciones = "";

            foreach (GridViewRow row in gdvCondiciones.Rows)
            {
                CheckBox check     = row.FindControl("chkAplica") as CheckBox;
                String   condicion = row.Cells[0].Text;
                int      aplica    = 0;
                if (check.Checked)
                {
                    aplica = 1;
                    contadorCondiciones++;
                }
                camposCondiciones  = camposCondiciones + "Condition" + contadorCampos + ", PointsC" + contadorCampos + ", ";
                valoresCondiciones = valoresCondiciones + "'" + condicion + "', " + aplica + ", ";
                contadorCampos++;
            }
            camposCondiciones  = camposCondiciones.Substring(0, camposCondiciones.Length - 2);
            valoresCondiciones = valoresCondiciones.Substring(0, valoresCondiciones.Length - 2);
            gdvCondiciones.Columns[0].Visible = false;
            if (contadorCondiciones > 0)
            {
                String clasificacion = "";
                if ((contadorCondiciones == 1) || (contadorCondiciones == 2))
                {
                    clasificacion = "C";
                }
                else if ((contadorCondiciones == 3) || (contadorCondiciones == 4))
                {
                    clasificacion = "B";
                }
                else if (contadorCondiciones >= 5)
                {
                    clasificacion = "A";
                }
                try
                {
                    bdTS.clsIngresarClasificacion(S, F, clasificacion, añoSelec + "", U, "0", camposCondiciones, valoresCondiciones);
                    bdTS.clsHstCambiarClasificacion(S, F, U, clasificacion);
                    DataTable dtFamilia  = BDF.obtenerDatos(S, F, L);
                    DataRow   rowFamilia = dtFamilia.Rows[0];
                    lblVClasActual.Text      = rowFamilia["Classification"].ToString();
                    lblVFechaClasActual.Text = rowFamilia["ClassifDate"].ToString();
                    llenarHistorialClasificaciones();
                    nuevaSeleccion();
                    mst.mostrarMsjNtf(dic.msjSeHaActualizado);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
                pnlAsignarClasif.Visible = false;
            }
            else
            {
                if (L.Equals("es"))
                {
                    mst.mostrarMsjAdvNtf("Debe al menos seleccionar una condición.");
                }
                else
                {
                    mst.mostrarMsjAdvNtf("You must at least select one condition.");
                }
            }
        }
        protected void btnCambiarPsw_Click(object sender, EventArgs e)
        {
            String newPsw  = "";
            String confPsw = "";
            String actPsw  = "";

            newPsw  = txbNuevaPsw.Text;
            confPsw = txbConfPsw.Text;
            actPsw  = txbActPsw.Text;
            DataTable a = BDU.verificarUltimas4Psw(U, newPsw);
            int       diferenteAUltimas4Psw = Convert.ToInt32(a.Rows[0][0]);
            string    msjAlertasPsw         = "";
            int       error = 0;

            string verificar = BDU.verificarCaracteresPsw(newPsw, U);
            string mayus     = "M";
            string minus     = "m";
            string num       = "1";
            string carac     = "8";

            if (diferenteAUltimas4Psw == 0)
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "No es distinta a las últimas 4." : "It is not different from the last 4.") + "</td></tr>";
            }
            if (mayus.Any(verificar.Contains))
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "No contiene mayúsculas." : "It does not contain capital letters.") + "</td></tr>";
            }

            if (minus.Any(verificar.Contains))
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "No contiene minúsculas." : "It does not contain lowercase letters.") + "</td></tr>";
            }

            if (num.Any(verificar.Contains))
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "No contiene números." : "It does not contain numbers.") + "</td></tr>";
            }

            if (carac.Any(verificar.Contains))
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "Tiene menos de 8 caracteres." : "It is less than 8 characters.") + "</td></tr>";
            }

            if (BDU.verificarNombrePsw(newPsw, U) != 0)
            {
                error         = error + 1;
                msjAlertasPsw = msjAlertasPsw + "<tr><td>- " + (L.Equals("es") ? "Incluye datos de su nombre o fechas fáciles de decifrar." : "It includes your name data or easy hacking dates.") + "</td></tr>";
            }

            if (newPsw == confPsw)
            {
                int sonIguales = BDU.verificarContraseña(U, actPsw);
                if (sonIguales == 1)
                {
                    if (newPsw != actPsw)
                    {
                        if (error > 0)
                        {
                            mst.mostrarMsjMdl(msjTituloPswNoCumple + msjAlertasPsw + "</table>");
                        }
                        else
                        {
                            try
                            {
                                BDU.cambiarContraseña(U, newPsw);
                                mst.mostrarMsjNtf(dic.msjSeHaActualizado);
                            }
                            catch (Exception ex)
                            {
                                mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                            }
                        }
                    }
                    else
                    {
                        mst.mostrarMsjAdvNtf(dic.msjNoSePermiteMismaPsw);
                        txbActPsw.Focus();
                    }
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjEsaNoEsPsw);
                    txbActPsw.Focus();
                }
            }
            else
            {
                mst.mostrarMsjAdvNtf(dic.msjNoSonIdenticosPsw);
                txbActPsw.Focus();
            }
        }