示例#1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String   aviso      = ddlAviso.SelectedValue;
            DateTime fechaAviso = Convert.ToDateTime(convertirAFechaAmericana(txbFechaAviso.Text));

            try
            {
                if (bdTS.avsNuevoAviso(S, F, area, aviso, fechaAviso.ToString("MM/dd/yyyy HH:mm:ss"), U))
                {
                    llenarGdvAvisos();
                    prepararPnlNuevoAviso();
                    mst.mostrarMsjNtf(dic.msjSeHaIngresado);
                }
                else
                {
                    if (L.Equals("es"))
                    {
                        mst.mostrarMsjAdvNtf("Una familia solo puede tener un aviso de cada tipo.");
                    }
                    else
                    {
                        mst.mostrarMsjAdvNtf("A family can only have one warning of each type.");
                    }
                }
            }
            catch (Exception ex)
            {
                mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
            }
        }
        protected void gvhistorial_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string miembro = gvhistorial.Rows[Convert.ToInt32(e.CommandArgument)].Cells[1].Text;
            string fecha   = gvhistorial.Rows[Convert.ToInt32(e.CommandArgument)].Cells[4].Text;

            string     sql  = "INSERT INTO dbo.MemberSponsorLetter SELECT Project,SponsorId,MemberId,SponsorOrMember,DateTimeWritten,GETDATE() CreationDateTime, RecordStatus,'" + U + "' UserId,ExpirationDateTime,GETDATE() DateSent, Category,Notes,Translated, SentToGuatemala FROM dbo.MemberSponsorLetter WHERE RecordStatus = ' ' AND MemberId='" + miembro + "' AND DateSent IS NULL AND convert(char, DateTimeWritten, 120)='" + fecha + "'";
            SqlCommand cmd2 = null;

            cmd2 = new SqlCommand(sql, con);

            try
            {
                con.Open();
                cmd2.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                mst.mostrarMsjAdvNtf(ex.Message);
            }
            finally
            {
                con.Close();
            }
            MostrarHistorial();
        }
 protected void accionar(object sender, EventArgs e)
 {
     sql = "UPDATE dbo.MemberActivity SET RecordStatus = 'H', ExpirationDateTime = GETDATE(), Notes = Notes + '" + U + "' WHERE RecordStatus = ' ' AND Project = '" + S + "' AND MemberId = " + M + " AND Convert(nvarchar(30), CreationDateTime, 21) = '" + creat + "' AND Type = '" + tipo + "'";
     APD.ejecutarSQL(sql);
     mst.mostrarMsjAdvNtf(dic.msjSeHaEliminado);
     LlenarHistorial();
 }
示例#4
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() + ".");
            }
        }
示例#5
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() + ".");
            }
        }
        private void eliminar()
        {
            ///////////////////////////////////////////////
            ddlcategoria.Enabled = true;
            ddltipo.Enabled      = true;
            chkentrega.Enabled   = true;
            string     sql2       = "INSERT INTO dbo.MemberGift SELECT Project,MemberId,Category,SelectionDateTime,GETDATE() CreationDateTime,'H' RecordStatus,'" + U + "' UserId,GETDATE() ExpirationDateTime,Type, Notes,DeliveryDateTime,SizeGift FROM dbo.MemberGift WHERE RecordStatus=' ' AND MemberId='" + Member + "' AND Project='" + Site + "' AND Notes='" + lblVnotas2.Text + "' AND Type ='" + ddltipo.SelectedValue + "' AND Category='" + ddlcategoria.SelectedValue + "' AND dbo.fn_GEN_FormatDate(SelectionDateTime,'" + L + "') ='" + lblVseleccion.Text + "'";
            string     actualizar = "UPDATE dbo.MemberGift SET RecordStatus='H', ExpirationDateTime=GETDATE() WHERE RecordStatus=' ' AND MemberId='" + Member + "' AND Project='" + Site + "' AND Notes='" + lblVnotas2.Text + "' AND Type ='" + ddltipo.SelectedValue + "' AND Category='" + ddlcategoria.SelectedValue + "' AND dbo.fn_GEN_FormatDate(SelectionDateTime,'" + L + "') ='" + lblVseleccion.Text + "'";
            SqlCommand cmd        = null;

            cmd = new SqlCommand(sql2, con);
            SqlCommand cmd2 = null;

            cmd2 = new SqlCommand(actualizar, con);
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                cmd2.ExecuteNonQuery();
                mst.mostrarMsjNtf(dic.RegistroEliminadoAPAD);
            }
            catch (Exception ex)
            {
                mst.mostrarMsjAdvNtf(ex.Message);
            }
            finally
            {
                con.Close();
            }

            LimpiarCampos();
            /////////////////////////////////////////////////////////////
        }
示例#7
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.");
         }
     }
 }
示例#8
0
 protected void btngenerar_Click(object sender, EventArgs e)
 {
     if (VerificarFechas())
     {
         mst.mostrarMsjNtf("Este reporte puede tomar unos minutos");
         llenarlistado();
     }
     else
     {
         mst.mostrarMsjAdvNtf("Ha olvidado llenar una fecha o no ha seleccionado una categoria");
     }
 }
示例#9
0
        protected void lblBuscar_Click(object sender, EventArgs e)
        {
            String memberId = txbMemberId.Text;
            String familyId = txbFamilyId.Text;
            String faroId   = txbFaroId.Text;

            if (!String.IsNullOrEmpty(memberId) && String.IsNullOrEmpty(familyId) && String.IsNullOrEmpty(faroId))
            {
                DataTable dtMiembro = new BDMiembro().obtenerDatos(S, memberId, L);
                if (dtMiembro.Rows.Count > 0)
                {
                    Session["M"] = memberId;
                    Response.Redirect("~/MISC/PerfilMiembro.aspx");
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroMiembro);
                }
            }
            else if (String.IsNullOrEmpty(memberId) && !String.IsNullOrEmpty(familyId) && String.IsNullOrEmpty(faroId))
            {
                DataTable dtFamilia = new BDFamilia().obtenerDatos(S, familyId, L);
                if (dtFamilia.Rows.Count > 0)
                {
                    Session["F"] = familyId;
                    Response.Redirect("~/MISC/PerfilFamilia.aspx");
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroFamilia);
                }
            }
            else if (String.IsNullOrEmpty(memberId) && String.IsNullOrEmpty(familyId) && !String.IsNullOrEmpty(faroId))
            {
                String familyIdFaro = "";
                familyIdFaro = (new BDFamilia().obtenerIdAPartirDeFaro(S, faroId)) + "";
                DataTable dtFamilia = new BDFamilia().obtenerDatos(S, familyIdFaro, L);
                if (dtFamilia.Rows.Count > 0)
                {
                    Session["F"] = familyIdFaro;
                    Response.Redirect("~/MISC/PerfilFamilia.aspx");
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroFamilia);
                }
            }
            else
            {
                mst.mostrarMsjAdvNtf(dic.msjDebeingresarUno);
            }
        }
        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.");
                }
            }
        }
示例#11
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     llenarGdvReferencias();
     pnlActualizar.Visible = false;
     if (gdvReferencias.Rows.Count > 0)
     {
         mst.mostrarModalYContenido(pnlReferencias);
     }
     else
     {
         mst.mostrarMsjAdvNtf("No se encontraron referencias.");
     }
 }
        //////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--////////////////////////////////////////////
        protected void accionar(object sender, EventArgs e)
        {
            switch (numAccion)
            {
            case 1:
                mst.redir("BusquedaPadrinosAPAD.aspx");
                break;

            case 2:
                try
                {
                    string        nombre    = HttpUtility.HtmlDecode(lblVnombre.Text.Replace(dic.nombre + " : ", ""));
                    string        sql       = "SELECT MemberId miembro FROM dbo.Member WHERE RecordStatus=' ' AND FirstNames+' '+LastNames =@nombre";
                    DataTable     tabledata = new DataTable();
                    SqlConnection conexion  = new SqlConnection(ConnectionString);
                    conexion.Open();
                    SqlCommand comando = new SqlCommand(sql, conexion);
                    comando.Parameters.AddWithValue("@nombre", nombre);
                    SqlDataAdapter adaptador = new SqlDataAdapter();
                    adaptador.SelectCommand = comando;

                    adaptador.Fill(tabledata);
                    conexion.Close();

                    string conteo = tabledata.Rows[0]["miembro"].ToString();

                    string sql2       = "INSERT dbo.SponsorMemberVisit SELECT Project,SponsorId,MemberId,VisitDateTime,GETDATE() CreationDateTime,'H' RecordStatus,'" + U + "' UserId,GETDATE() ExpirationDateTime, Notes FROM dbo.SponsorMemberVisit WHERE RecordStatus=' ' AND SponsorId='" + P + "' AND MemberId='" + conteo + "' AND CONVERT(VARCHAR,VisitDateTime,120)='" + txtfechav.Text + "' AND Notes='" + lblvalornotas.Text + "'";
                    string actualizar = "UPDATE dbo.SponsorMemberVisit SET RecordStatus='H', ExpirationDateTime=GETDATE() WHERE RecordStatus=' ' AND SponsorId='" + P + "' AND MemberId='" + conteo + "' AND CONVERT(VARCHAR,VisitDateTime,120)='" + txtfechav.Text + "' AND Notes='" + lblvalornotas.Text + "'";

                    SqlCommand cmd3 = null;
                    cmd3 = new SqlCommand(actualizar, con);
                    SqlCommand cmd4 = null;
                    cmd4 = new SqlCommand(sql2, con);
                    con.Open();
                    int fil  = cmd4.ExecuteNonQuery();
                    int fil2 = cmd3.ExecuteNonQuery();
                    if (fil < 0)
                    {
                        mst.mostrarMsjAdvNtf("errorsql2");
                    }
                    if (fil2 < 0)
                    {
                        mst.mostrarMsjAdvNtf("erroractualizar");
                    }
                    limpiarCampos();
                    llenarhistorial();
                    traducir();
                    mst.mostrarMsjNtf(dic.msjSeHaEliminado);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
                break;
            }
        }
示例#13
0
 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 Page_Load(object sender, EventArgs e)
        {
            M = mast.M;
            L = mast.L;
            S = mast.S;
            F = mast.F;
            U = mast.U;

            mst = (mast)Master;
            APD = new BDAPAD();
            dic = new Diccionario(L, S);
            BDM = new BDMiembro();
            // mst.contentCallEvent += new EventHandler(accionar);
            if (!IsPostBack)
            {
                mst = (mast)Master;
                BDM = new BDMiembro();
                APD = new BDAPAD();
                try
                {
                    if (string.IsNullOrEmpty(M))
                    {
                        pnltodo.Visible = false;
                    }
                    else
                    {
                        ValoresIniciales();
                    }
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(ex.Message);
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     M   = mast.M;
     L   = mast.L;
     S   = mast.S;
     F   = mast.F;
     U   = mast.U;
     BDM = new BDMiembro();
     APD = new BDAPAD();
     dic = new Diccionario(L, S);
     mst = (mast)Master;
     if (!IsPostBack)
     {
         try
         {
             Traducir();
             llenarhistorial();
             llenarcombos();
             llenarmese();
         }
         catch (Exception ex)
         {
             mst.mostrarMsjAdvNtf(ex.Message);
         }
     }
 }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            M = mast.M;
            L = mast.L;
            S = mast.S;
            F = mast.F;
            U = mast.U;

            mst = (mast)Master;
            //       APD = new BDAPAD();
            dic = new Diccionario(L, S);
            if (!IsPostBack)
            {
                mst = (mast)Master;
                APD = new BDAPAD();
                try
                {
                    ValoresIniciales();
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(ex.Message);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            M = mast.M;
            L = mast.L;
            S = mast.S;
            F = mast.F;
            U = mast.U;

            mst = (mast)Master;
            APD = new BDAPAD();
            dic = new Diccionario(L, S);
            BDM = new BDMiembro();
            // mst.contentCallEvent += new EventHandler(accionar);
            if (!IsPostBack)
            {
                dtAsistenciasAux = new DataTable();
                dtAsistencias    = new DataTable();
                mst = (mast)Master;
                BDM = new BDMiembro();
                APD = new BDAPAD();
                try
                {
                    ValoresIniciales();
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(ex.Message);
                }
            }
        }
 protected void btngenerar_Click(object sender, EventArgs e)
 {
     if (ddlactividad.SelectedIndex == 0 || txtanio.Text.Length < 4)
     {
         mst.mostrarMsjAdvNtf("Por fabor llene los campos de año y actividad");
     }
     else
     {
         if (chkinfogen.Checked == true)
         {
             LlenarInfoGen();
         }
         else
         {
             LlenarInfo();
         }
     }
 }
示例#19
0
        private void guardarviveres()
        {
            String   razon      = ddlrazon.SelectedValue;
            String   cantidad   = ddlCantidad.SelectedValue;
            String   frecuencia = ddlFrecuencia.SelectedValue;
            DateTime hoy        = DateTime.Now;

            if (bdTS.vvrVerificarIngreso(S, F, razon, hoy.ToString("yyyy-MM-dd HH:mm:ss")))
            {
                string     sql = "INSERT dbo.FamilyHelp (Project, FamilyId, Reason, AuthorizationDateTime, CreationDateTime, RecordStatus, UserId, ExpirationDateTime, Notes, Quantity, Frecuency, AuthorizedBy) VALUES('" + S + "', '" + F + "', '" + razon + "', '" + hoy.ToString("yyyy-MM-dd HH:mm:ss") + "', '" + hoy.ToString("yyyy-MM-dd HH:mm:ss") + "', ' ', '" + U + "', NULL, '" + txtnotas.Text + "', '" + cantidad + "', '" + frecuencia + "', '" + U + "')";
                SqlCommand cmd = null;

                cmd = new SqlCommand(sql, con);

                try
                {
                    dic = new Diccionario(L, S);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    llenarhistorial();
                    limpiar();
                    mst.mostrarMsjNtf(dic.msjSeHaIngresado);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
                finally
                {
                    con.Close();
                }
            }
            else
            {
                if (L.Equals("es"))
                {
                    mst.mostrarMsjAdvNtf("Una familia solo puede recibir víveres por cierta razón, por día.");
                }
                else
                {
                    mst.mostrarMsjAdvNtf("A family can only receive helps for a certain reason, per day.");
                }
            }
        }
示例#20
0
 protected void btnBuscar_Click(object sender, EventArgs e)
 {
     pnlAsignar.Visible = false;
     area = ddlArea.SelectedValue;
     TS   = ddlTS.SelectedValue;
     if (!String.IsNullOrEmpty(area) || !String.IsNullOrEmpty(TS))
     {
         DataTable dtFamilias = BDF.obtenerFamiliasAfiliadas(S, L, TS, area);
         if (dtFamilias.Rows.Count > 0)
         {
             gdvFamilias.Columns[1].HeaderText = dic.familia;
             gdvFamilias.Columns[2].HeaderText = dic.trabajadorS;
             gdvFamilias.Columns[3].HeaderText = dic.fechaInicio;
             gdvFamilias.Columns[4].HeaderText = dic.jefeCasa;
             gdvFamilias.Columns[5].HeaderText = dic.direccion;
             gdvFamilias.Columns[6].HeaderText = dic.area;
             gdvFamilias.DataSource            = dtFamilias;
             gdvFamilias.DataBind();
             gdvFamilias.Columns[0].Visible = false;
             pnlBuscar.Visible  = false;
             pnlAsignar.Visible = true;
         }
         else
         {
             mst.mostrarMsjAdvNtf(dic.msjNoEncontroResultados);
         }
     }
     else
     {
         if (L.Equals("es"))
         {
             mst.mostrarMsjAdvNtf("Por favor, ingrese al menos un parámetro.");
         }
         else
         {
             mst.mostrarMsjAdvNtf("Please, enter at least one parameter.");
         }
     }
 }
示例#21
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String memberId = txbMiembro.Text;
            String familyId = txbFamilia.Text;

            if (!String.IsNullOrEmpty(memberId) && String.IsNullOrEmpty(familyId))
            {
                DataTable dtMiembro = new BDMiembro().obtenerDatos(S, memberId, L);
                if (dtMiembro.Rows.Count > 0)
                {
                    guardar(memberId);
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroMiembro);
                }
            }
            else if (String.IsNullOrEmpty(memberId) && !String.IsNullOrEmpty(familyId))
            {
                DataTable dtFamilia = new BDFamilia().obtenerDatos(S, familyId, L);
                if (dtFamilia.Rows.Count > 0)
                {
                    gdvMiembros.Columns[0].Visible = true;
                    gdvMiembros.DataSource         = new BDFamilia().obtenerActivos(S, familyId, L);
                    gdvMiembros.DataBind();
                    gdvMiembros.Columns[0].Visible = false;
                    pnlActualizar.Visible          = false;
                    mst.mostrarModalYContenido(pnlMiembros);
                }
                else
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoEncontroFamilia);
                }
            }
            else
            {
                mst.mostrarMsjAdvNtf(dic.msjDebeingresarUno);
            }
        }
示例#22
0
 public DataTable LlenarDataTable(String SQL, DataTable tabledata)
 {
     try
     {
         con.Open();
         SqlCommand     comando   = new SqlCommand(SQL, con);
         SqlDataAdapter adaptador = new SqlDataAdapter();
         adaptador.SelectCommand = comando;
         adaptador.Fill(tabledata);
         con.Close();
         return(tabledata);
     }
     catch (Exception ex)
     {
         mst.mostrarMsjAdvNtf(ex.Message);
         DataTable d = new DataTable();
         return(d);
     }
 }
示例#23
0
        private void LlenarInformacion()
        {
            string miembro   = txtmiembro.Text;
            string sql       = "SELECT COUNT(*) conteo FROM Family WHERE Project='F' AND RecordStatus=' ' AND FamilyId='" + miembro + "' AND AffiliationStatus='AFIL'";
            string resultado = obtienePalabra(sql, "conteo");

            if (resultado == "0")
            {
                mst.mostrarMsjAdvNtf("La familia no es Afiliada");
            }
            else
            {
                if (string.IsNullOrEmpty(txtmiembro.Text))
                {
                    mst.mostrarMsjAdvNtf("Por favor llene el miembro");
                }
                else
                {
                    sql = "SELECT M.MemberId,M.LastNames,M.FirstNames,CONVERT(VARCHAR,M.BirthDate,110)+ ' '+ dbo.fn_GEN_edad(M.BirthDate, '" + L + "') 'Cumpleaños/Edad',F.Classification 'Clasificación' FROM dbo.Member M INNER JOIN dbo.Family F ON M.RecordStatus=F.RecordStatus AND M.Project=F.Project AND M.LastFamilyId=F.FamilyId WHERE M.RecordStatus=' 'AND M.LastFamilyId='" + miembro + "' AND M.Project='" + S + "'";
                    LLenarHistorial(sql, gvhistorial);
                }
            }
        }
示例#24
0
        /////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--//////////////////////////////////////////
        private void comprobar_registro(string fecha, string miembro)
        {
            string     sql = "INSERT INTO dbo.MemberGift SELECT	Project, MemberId, Category, SelectionDateTime,GETDATE() CreationDateTime,' ' RecordStatus,'" + U + "' UserId,ExpirationDateTime,Type,Notes,GETDATE() DeliveryDateTime,SizeGift FROM DBO.MemberGift  WHERE CONVERT(VARCHAR,SelectionDateTime,120)='" + fecha + "'  AND MemberId='" + miembro + "'";
            SqlCommand cmd = null;

            cmd = new SqlCommand(sql, con);

            try
            {
                dic = new Diccionario(L, S);
                con.Open();
                cmd.ExecuteNonQuery();
                filtrargrid();
                mst.mostrarMsjNtf(dic.RegistroIngresadoAPAD);
            }
            catch (Exception ex)
            {
                mst.mostrarMsjAdvNtf(ex.Message);
            }
            finally
            {
                con.Close();
            }
        }
 //////////////////////////////////////////////////////////////-EVENTOS-////////////////////////////////////////////////////////
 protected void Page_Load(object sender, EventArgs e)
 {
     M   = mast.M;
     L   = mast.L;
     S   = mast.S;
     F   = mast.F;
     U   = mast.U;
     P   = mast.P;
     dic = new Diccionario(L, S);
     P   = (String)Session["P"];
     mst = (mast)Master;
     APD = new BDAPAD();
     mst.contentCallEvent += new EventHandler(accionar);
     if (String.IsNullOrEmpty(P))
     {
         string notiene;
         if (L == "es")
         {
             notiene = "No has seleccionado ningún padrino";
         }
         else
         {
             notiene = "You have not selected any sponsors";
         }
         numAccion = 1;
         mst.mostrarMsjOpcionMdl(notiene);
     }
     else
     {
         if (!IsPostBack)
         {
             try
             {
                 BDM = new BDMiembro();
                 APD = new BDAPAD();
                 traducir();
                 llenarhistorial();
                 apadrinado();
             }
             catch (Exception ex)
             {
                 mst.mostrarMsjAdvNtf("Error: " + ex.Message);
             }
         }
     }
 }
示例#26
0
 private void llenargrid(string sql, GridView gv)
 {
     try
     {
         DataTable tabledata = new DataTable();
         con.Open();
         SqlDataAdapter adaptador = new SqlDataAdapter(sql, con);
         DataSet        setDatos  = new DataSet();
         adaptador.Fill(setDatos, "listado");
         tabledata = setDatos.Tables["listado"];
         con.Close();
         gv.DataSource = tabledata;
         gv.DataBind();
     }
     catch (Exception ex)
     {
         mst.mostrarMsjAdvNtf(ex.Message);
     }
 }
        //////////////////////////////////////////////////////////////-EVENTOS-////////////////////////////////////////////////////////

        protected void Page_Load(object sender, EventArgs e)
        {
            M = mast.M;
            L = mast.L;
            S = mast.S;
            F = mast.F;
            U = mast.U;

            mst = (mast)Master;
            APD = new BDAPAD();
            dic = new Diccionario(L, S);
            BDM = new BDMiembro();
            mst.contentCallEvent += new EventHandler(accionar);
            if (!IsPostBack)
            {
                mst = (mast)Master;
                BDM = new BDMiembro();
                APD = new BDAPAD();
                try
                {
                    if (string.IsNullOrEmpty(M))
                    {
                        gvhistorial.Visible = false;
                        tbregistro.Visible  = false;
                        tbfiltros.Visible   = false;
                    }
                    else
                    {
                        Site   = S;
                        Member = M;
                        valoresiniciales(Site, Member);
                    }
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(ex.Message);
                }
            }
        }
示例#28
0
        public void Foto(string S, string M, int grad, string direccion)
        {
            try
            {
                con.Open();
                String   sql      = "SELECT CASE WHEN dbo.fn_SPON_LastMemberPhoto ('" + S + "','" + M + "') IS NULL THEN ' ' ELSE dbo.fn_SPON_LastMemberPhoto ('" + S + "','" + M + "') END resultado";
                string   photourl = obtienePalabra(sql, "resultado");
                String[] newurl   = photourl.Split(':');

                string newsubstring = photourl.Replace(@"G:\", "");
                newsubstring = newsubstring.Replace(@"V:\", "");
                newsubstring = newsubstring.Replace(@"g:\", "");
                Boolean foto;
                foto = System.IO.File.Exists(direccion + newurl[1]);
                if (foto == false)
                {
                    lblfecha.Text = dic.MsjNoContieneFotoAPAD;
                    imgApadFoto.Attributes["src"] = "../Images/CommonHope_Heart_RGB.png";
                }
                else
                {
                    if (grad == 0)
                    {
                        imgApadFoto.Attributes["src"] = "../Imagen.ashx?imageID=" + newurl[1].ToString();
                    }
                    else
                    {
                        imgApadFoto.Attributes["src"] = "../ImagenG.ashx?imageID=" + newurl[1].ToString();
                    }
                }
            }
            catch (Exception e)
            {
                mst.mostrarMsjAdvNtf(e.Message);
            }
            finally
            {
                con.Close();
            }
        }
示例#29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            M = mast.M;
            L = mast.L;
            S = mast.S;
            F = mast.F;
            U = mast.U;

            mst = (mast)Master;
            APD = new BDAPAD();
            dic = new Diccionario(L, S);
            BDM = new BDMiembro();

            if (!IsPostBack)
            {
                mst = (mast)Master;
                BDM = new BDMiembro();
                APD = new BDAPAD();
                try
                {
                    // ValoresIniciales();
                    lnkb1.Text = "<span class='fa fa-trash'> <p>" + dic.eliminar + "</p></span>";
                    lnkb2.Text = "<span class='fa fa-check'> <p>" + dic.aceptar + "</p></span>";
                    lnkb3.Text = "<span class='fa fa-save'> <p>" + dic.guardar + "</p></span>";
                    lnkb4.Text = "<span class='fa fa-edit'> <p>" + dic.ModificarAPAD + "</p></span>";
                    lnkb5.Text = "<span class='fa fa-trash'> <p>" + dic.eliminar + "</p></span>";
                    lnkb6.Text = "<span class='fa fa-check'> <p>" + dic.aceptar + "</p></span>";
                    lnkb7.Text = "<span class='fa fa-save'> <p>" + dic.guardar + "</p></span>";
                    lnkb8.Text = "<span class='fa fa-edit'> <p>" + dic.ModificarAPAD + "</p></span>";
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(ex.Message);
                }
            }
        }
 //////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--//////////////////////////////////////////
 protected void accionar(object sender, EventArgs e)
 {
     switch (opcion)
     {
     case 1:
         try
         {
             APD.ejecutarSQL(consulta);
             LlenarHistorial(S);
             Limpiar();
             mst.mostrarMsjNtf(dic.msjSeHaActualizado);
         }
         catch (Exception ex)
         {
             mst.mostrarMsjAdvNtf(dic.msjNoSeRealizoExcp + ex.Message + ".");
         }
         break;
     }
 }