Beispiel #1
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         String diagnostico = ddlDiagnostico.SelectedValue;
         String nota        = txbNotas.Text;
         string post;
         if (ckbPreOPost.Checked == true)
         {
             post = "1";
         }
         else
         {
             post = "0";
         }
         bdTS.anlVvnNuevoAnalisis(S, familia, U, diagnostico, nota, post);
         llenarTblVVnd();
         btnEliminarAnalisis.Visible = true;
         mst.mostrarMsjNtf(dic.msjSeHaIngresado);
     }
     catch (Exception ex)
     {
         mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
     }
 }
Beispiel #2
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() + ".");
            }
        }
Beispiel #3
0
        public string obtienePalabra(String sql, String titulo)
        {
            try
            {
                SqlDataAdapter  daUser = new SqlDataAdapter();
                DataTableReader adap;
                DataTable       tableData = new DataTable();
                string          temp      = "";


                con.Open();
                daUser = new SqlDataAdapter(sql, ConnectionString);
                daUser.Fill(tableData);
                adap = new DataTableReader(tableData);
                con.Close();
                temp = Convert.ToString(tableData.Rows[0][titulo]);

                return(temp);
            }
            catch (Exception ex)
            {
                mst.mostrarMsjNtf("Error" + ex.Message);
                string temp = "||||||";
                return(temp);
            }
        }
Beispiel #4
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() + ".");
            }
        }
Beispiel #5
0
 protected void btntoposrem_Click(object sender, EventArgs e)
 {
     sql = "SELECT Tipo, SUM(Cantidad) Total, SUM([Cantidad Aprobada]) Aprobado FROM dbo.fn_GEN_HistorialPagos('" + S + "', " + M + ") WHERE YEAR(FechaA) = " + lblVanio.Text + " AND Area = 'EDUC' GROUP BY  Tipo ORDER BY  Tipo ";
     llenargrid(sql, gvrem);
     if (gvrem.Rows.Count == 0)
     {
         mst.mostrarMsjNtf(dic.msjNoEncontroResultados);
     }
 }
        //////////////////////////////////////////////////////--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;
            }
        }
Beispiel #7
0
        protected void Eliminar()
        {
            string sql = "INSERT INTO dbo.MemberSponsorLetter SELECT Project,SponsorId,MemberId,SponsorOrMember,DateTimeWritten,GETDATE() CreationDateTime,'H' RecordStatus,'" + U + "' UserId,GETDATE() ExpirationDateTime,DateSent,Category, Notes,Translated,SentToGuatemala FROM dbo.MemberSponsorLetter WHERE RecordStatus=' ' AND Project='" + lblnotas1.Text + "' AND MemberId='" + lblVmiembro.Text + "' AND SponsorOrMember='S'  AND SponsorId='" + P + "' AND CONVERT(VARCHAR,DateTimeWritten,101)='" + lblVfecha.Text + "'";

            ejecutarSQL(sql);
            sql = "UPDATE dbo.MemberSponsorLetter SET RecordStatus='H', ExpirationDateTime=GETDATE() WHERE RecordStatus=' ' AND Project='" + lblnotas1.Text + "' AND MemberId='" + lblVmiembro.Text + "' AND SponsorOrMember='S'  AND SponsorId='" + P + "' AND CONVERT(VARCHAR,DateTimeWritten,101)='" + lblVfecha.Text + "'";
            ejecutarSQL(sql);
            traducir();
            llenarhistorial();
            mst.mostrarMsjNtf(dic.RegistroEliminadoAPAD);
        }
Beispiel #8
0
 protected void btnaceptar_Click(object sender, EventArgs e)
 {
     if (ddlrazon.SelectedIndex == 0)
     {
         mst.mostrarMsjNtf(dic.CampoVacioAPAD);
     }
     else
     {
         guardarviveres();
     }
 }
        protected void modificar()
        {
            string     sql        = "INSERT INTO dbo.FamilyHelp (Project, FamilyId, Reason, AuthorizationDateTime, CreationDateTime, RecordStatus, UserId, ExpirationDateTime, Notes, Quantity, Frecuency, AuthorizedBy, DeliveryDateTime1, DeliveredBy1, DeliveryDateTime2, DeliveredBy2, DeliveryDateTime3, DeliveredBy3, DeliveryDateTime4, DeliveredBy4) SELECT Project, FamilyId, Reason, AuthorizationDateTime, CONVERT(varchar, GETDATE(), 20) CreationDateTime, RecordStatus, '" + U + "' UserId, ExpirationDateTime, '" + notasSLCT + "' Notes, '" + cantidadSLCT + "' Quantity, '" + frecuenciaSLCT + "' Frecuency, AuthorizedBy, " + (haceEntrega1 ? "CONVERT(varchar, GETDATE(), 20)" : "NULL") + ", " + (haceEntrega1 ? "'" + U + "'" : "NULL") + ",  " + (haceEntrega2 ? "CONVERT(varchar, GETDATE(), 20)" : "NULL") + ", " + (haceEntrega2 ? "'" + U + "'" : "NULL") + ",  " + (haceEntrega3 ? "CONVERT(varchar, GETDATE(), 20)" : "NULL") + ", " + (haceEntrega3 ? "'" + U + "'" : "NULL") + ",  " + (haceEntrega4 ? "CONVERT(varchar, GETDATE(), 20)" : "NULL") + ", " + (haceEntrega4 ? "'" + U + "'" : "NULL") + " FROM dbo.FamilyHelp WHERE RecordStatus = ' ' AND Project = '" + S + "' AND FamilyId = '" + F + "' AND Reason = '" + razonSLCT + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fechaAutorizacionSLCT + "'";
            string     actualizar = "UPDATE dbo.FamilyHelp SET RecordStatus='H', ExpirationDateTime = CONVERT(varchar, GETDATE(),20) WHERE RecordStatus = ' ' AND Project = '" + S + "' AND FamilyId = '" + F + "' AND Reason = '" + razonSLCT + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fechaAutorizacionSLCT + "' AND CONVERT(varchar, CreationDateTime, 21) != (SELECT MAX(CONVERT(varchar, FH2.CreationDateTime, 21)) FROM FamilyHelp FH2 WHERE FH2.RecordStatus = ' ' AND FH2.Project = '" + S + "' AND FH2.FamilyId = " + F + " AND Reason = '" + razonSLCT + "' AND CONVERT(varchar, AuthorizationDateTime, 21) = '" + fechaAutorizacionSLCT + "')";
            SqlCommand cmd        = null;

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

            cmd2 = new SqlCommand(actualizar, con);
            try
            {
                dic = new Diccionario(L, S);
                con.Open();
                cmd.ExecuteNonQuery();
                cmd2.ExecuteNonQuery();
                llenarhistorial();
                mst.mostrarMsjNtf(dic.msjSeHaActualizado);
            }
            catch (Exception ex)
            {
                mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
            }
            finally
            {
                con.Close();
                pnlRegistro.Visible = false;
            }
        }
 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;
         }
     }
 }
Beispiel #11
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() + ".");
            }
        }
Beispiel #12
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         String   existeUsuario;
         String   existeActividad;
         String   existeMiembro;
         String   usuario;
         String   miembro;
         String   actividad;
         DateTime fechaActividad;
         foreach (GridViewRow row in gdvAsistencias.Rows)
         {
             existeUsuario   = row.Cells[0].Text;
             existeActividad = row.Cells[1].Text;
             existeMiembro   = row.Cells[2].Text;
             usuario         = row.Cells[3].Text;
             actividad       = row.Cells[5].Text;
             miembro         = row.Cells[7].Text;
             fechaActividad  = Convert.ToDateTime(row.Cells[4].Text);
             if (existeUsuario.Equals("S") && existeActividad.Equals("S") && existeMiembro.Equals("S"))
             {
                 bdAPJO.ingresarAsistenciaArchivo(S, miembro, fechaActividad.ToString("yyyy-MM-dd HH:mm:ss"), actividad, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), usuario, "", "", "");
             }
         }
         mst.mostrarMsjNtf(dic.msjSeHanIngresado);
     }
     catch (Exception ex)
     {
         mst.mostrarMsj(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();
            /////////////////////////////////////////////////////////////
        }
Beispiel #14
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.");
                }
            }
        }
Beispiel #15
0
        protected void guardar(String miembro)
        {
            miembroSLCT   = miembro;
            tipoActividad = ddlActividad.SelectedValue;
            DateTime ahora         = DateTime.Now;
            String   fechaCreacion = ahora.ToString("yyyy-MM-dd HH:mm:ss");
            String   fechaAsistencia;
            String   fechaSalida;
            String   comentarios = txbComentarios.Text;
            String   impresiones = txbImpresiones.Text;

            if (!seleccionarFecha)
            {
                fechaAsistencia = ahora.ToString("yyyy-MM-dd HH:mm:ss");
                fechaSalida     = "";
            }
            else
            {
                DateTime fechaAsistenciaAux = Convert.ToDateTime(txbFecha.Text);

                DateTime horaAsistenciaAux     = Convert.ToDateTime(txbHora.Text);
                String   fechaAsistenciaAuxStr = fechaAsistenciaAux.Year + "-" + fechaAsistenciaAux.Month + "-" + fechaAsistenciaAux.Day + " " + horaAsistenciaAux.Hour + ":" + horaAsistenciaAux.Minute;
                fechaAsistencia = fechaAsistenciaAuxStr;

                if (!String.IsNullOrEmpty(txbHoraSalida.Text))
                {
                    DateTime horaSalidaAsistenciaAux     = Convert.ToDateTime(txbHoraSalida.Text);
                    String   fechaSalidaAsistenciaAuxStr = fechaAsistenciaAux.Year + "-" + fechaAsistenciaAux.Month + "-" + fechaAsistenciaAux.Day + " " + horaSalidaAsistenciaAux.Hour + ":" + horaSalidaAsistenciaAux.Minute;
                    fechaSalida = fechaSalidaAsistenciaAuxStr;
                }
                else
                {
                    fechaSalida = "";
                }
            }
            bdPROE.ingresarAsistencia(S, miembroSLCT, fechaAsistencia, tipoActividad, fechaCreacion, U, comentarios, impresiones, fechaSalida);
            llenarGdvAsistencias();
            mst.mostrarMsjNtf(dic.msjSeHaIngresado);
            txbComentarios.Text = "";
            txbImpresiones.Text = "";
            txbMiembro.Text     = "";
            txbFamilia.Text     = "";
        }
 //////////////////////////////////////////////////////--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;
     }
 }
Beispiel #17
0
        public void GuardarCarta()
        {
            string me  = string.Empty;
            string me2 = string.Empty;

            foreach (GridViewRow gvrow in GridView1.Rows)
            {
                CheckBox chk = (CheckBox)gvrow.FindControl("chkagregar");
                if (chk.Checked)
                {
                    me = gvrow.Cells[1].Text;
                    string categoria = ddlcat.SelectedValue;
                    string notas     = txtnotas.Text;
                    GCarta(S, me, M, "GETDATE()", U, categoria, notas, "M");
                }
            }
            registrocarta();
            limpiarcampos_carta();
            mst.mostrarMsjNtf(dic.RegistroIngresadoAPAD);
        }
Beispiel #18
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");
     }
 }
 //////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--//////////////////////////////////////////
 protected void GuardarCarnet()
 {
     if (string.IsNullOrEmpty(txbmiembro.Text) || ddlsitio.SelectedIndex == 0)
     {
         mst.mostrarMsjNtf(dic.CampoVacioAPAD);
     }
     else
     {
         string sitio     = ddlsitio.SelectedValue;
         string miembro   = txbmiembro.Text;
         string sql       = "SELECT COUNT(*) conteo FROM dbo.Member WHERE RecordStatus=' ' AND MemberId='" + miembro + "' AND Project='" + sitio + "' AND AffiliationStatus='AFIL'";
         int    resultado = APD.ObtenerEntero(sql, "conteo");
         if (resultado == 0)
         {
             mst.mostrarMsjNtf(dic.MsjmiembronoApadrinado);
         }
         else
         {
             sql = "SELECT COUNT(*) conteo FROM MemberSolicitudeCard WHERE RecordStatus=' ' AND Project='" + sitio + "' AND MemberId='" + miembro + "'";
             int resultado2 = APD.ObtenerEntero(sql, "conteo");
             if (resultado2 == 1)
             {
                 mst.mostrarMsjNtf(dic.MsjYaingresoRegistro);
             }
             else
             {
                 string sql2 = "INSERT INTO MemberSolicitudeCard VALUES('" + sitio + "','" + miembro + "',GETDATE(),GETDATE(),'" + U + "',' ','" + U + "',NULL,NULL)";
                 APD.ejecutarSQL(sql2);
                 Limpiar();
                 llenarhistorial();
                 mst.mostrarMsjNtf(dic.RegistroIngresadoAPAD);
             }
         }
     }
 }
Beispiel #20
0
        protected void btningresar_Click(object sender, EventArgs e)
        {
            string me     = string.Empty;
            string me2    = string.Empty;
            int    conteo = 0;

            foreach (GridViewRow gvrow in gvhistorial.Rows)
            {
                CheckBox chk = (CheckBox)gvrow.FindControl("chkentregado");

                if (chk.Checked)
                {
                    conteo = conteo + 1;
                }
            }
            if (conteo == 0)
            {
                mst.mostrarMsjAdvNtf(dic.MsjNohaSeleccionadomiembro);
            }
            else
            {
                foreach (GridViewRow gvrow in gvhistorial.Rows)
                {
                    CheckBox chk = (CheckBox)gvrow.FindControl("chkentregado");
                    if (chk.Checked)
                    {
                        me2 = gvrow.Cells[1].Text;
                        me  = gvrow.Cells[2].Text;
                        string        consulta  = "SELECT COUNT(*) conteo FROM dbo.SponsorMemberRelation WHERE RecordStatus=' ' AND EndDate IS NULL AND Project = '" + me2 + "' AND MemberId=" + me + "";
                        int           resultado = ObtenerEntero(consulta, "conteo");
                        string        tabla     = "SELECT SponsorId FROM dbo.SponsorMemberRelation WHERE RecordStatus=' ' AND EndDate IS NULL AND Project = '" + me2 + "' AND MemberId=" + me + "";
                        DataTable     tabledata;
                        SqlConnection conexion = new SqlConnection(ConnectionString);
                        conexion.Open();
                        SqlDataAdapter adaptador = new SqlDataAdapter(tabla, conexion);
                        DataSet        setDatos  = new DataSet();
                        adaptador.Fill(setDatos, "listado");
                        tabledata = setDatos.Tables["listado"];
                        conexion.Close();
                        for (int a = 0; a < resultado; a++)
                        {
                            string padrino = tabledata.Rows[a]["SponsorId"].ToString();;
                            IngresoCarta(padrino, me, me2);
                        }
                    }
                }
                mostrarhistorialF(1);
                mst.mostrarMsjNtf(dic.RegistroIngresadoAPAD);
            }
        }
 protected void accionar(object sender, EventArgs e)
 {
     if (accion == 1)
     {
         tbinfo.Visible = false;
         limpiar();
         DateTime d         = DateTime.Now;
         DateTime Now       = Convert.ToDateTime(txtfechav.Text);
         string   miembro   = member;
         String   fechaHora = Now.Year.ToString() + "/" + Now.Month.ToString() + "/" + Now.Day.ToString() + " " + d.ToLongTimeString();
         sql = "INSERT INTO  dbo.MemberActivity VALUES ('" + S + "', " + miembro + ", '" + ddltipo.SelectedValue + "', '" + Convert.ToDateTime(fechaHora).ToString("MM/dd/yyyy hh:mm:ss") + "', GETDATE(), ' ', '" + U + "', NULL, '" + txtobservaciones.Text + "')";
         //Response.Write(sql);
         APD.ejecutarSQL(sql);
         mst.mostrarMsjNtf(dic.msjSeHaIngresado);
         LLenarhistorial();
     }
     else if (accion == 2)
     {
         sql = "UPDATE dbo.MemberActivity SET RecordStatus = 'H', ExpirationDateTime = GETDATE() WHERE RecordStatus = ''  AND Project = '" + S + "' AND MemberId = " + member + " AND convert(varchar, ActivityDateTime, 120) = convert(varchar, '" + fecha2 + "', 120) ";
         APD.ejecutarSQL(sql);
         LLenarhistorial();
         mst.mostrarMsjNtf(dic.msjSeHaEliminado);
     }
 }
Beispiel #22
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() + ".");
     }
 }
 protected void btningresar_Click(object sender, EventArgs e)
 {
     if (ddlactividad.SelectedIndex == 0 || txtfechav.Text.Length < 10)
     {
         mst.mostrarMsjAdvNtf("No ha llenado los campos necesarios");
     }
     else
     {
         DateTime d         = DateTime.Now;
         DateTime Now       = Convert.ToDateTime(txtfechav.Text);
         String   fechaHora = Now.Year.ToString() + "/" + Now.Month.ToString() + "/" + Now.Day.ToString() + " " + d.ToLongTimeString();
         sql = "INSERT INTO dbo.MemberActivity VALUES ('" + S + "', " + M + ", '" + ddlactividad.SelectedValue + "', '" + Convert.ToDateTime(fechaHora).ToString("MM/dd/yyyy hh:mm:ss") + "', GETDATE(), ' ', '" + U + "', NULL, '" + txtobservaciones.Text + "')";
         APD.ejecutarSQL(sql);
         mst.mostrarMsjNtf(dic.msjSeHaIngresado);
         LlenarHistorial();
         limpiar();
     }
 }
 protected void btnguardarpartedos_Click(object sender, EventArgs e)
 {
     if (GridView1.Rows.Count == 0)
     {
         mst.mostrarMsjAdvNtf("No tiene registros");
     }
     else
     {
         int conteo = 0;
         foreach (GridViewRow gvr in GridView1.Rows)
         {
             CheckBox chk = new CheckBox();
             chk = (CheckBox)gvr.FindControl("chkselect");
             string miembro = gvr.Cells[2].Text;
             string mmm     = gvr.Cells[1].Text;
             if (chk.Checked == true)
             {
                 conteo++;
             }
         }
         if (conteo == 0)
         {
             mst.mostrarMsjAdvNtf("No ha seleccionado ningun miembro");
         }
         else
         {
             int registros = 0;
             foreach (GridViewRow gvr in GridView1.Rows)
             {
                 CheckBox chk = new CheckBox();
                 chk = (CheckBox)gvr.FindControl("chkselect");
                 string miembro = gvr.Cells[2].Text;
                 string mmm     = gvr.Cells[1].Text;
                 string fecha   = txbafecha.Text + " " + txthora.Text + ":00";
                 if (chk.Checked == true)
                 {
                     IngresarActividad(mmm, fecha);
                     registros++;
                 }
             }
             mst.mostrarMsjNtf("Se realizaron " + registros + " ingresos.");
         }
     }
 }
Beispiel #25
0
        public void imagen()
        {
            try
            {
                string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);

                DateTime fehchaA       = DateTime.Now;
                string   cadena        = fehchaA.ToString("yyyyMMddHHmmss");
                string   nuevoarchivo  = S + M + "_" + cadena + ".jpg";
                string   archivo       = Path.GetFileName(FileUpload1.PostedFile.FileName);
                string   carpeta_final = Path.Combine(locacion2, nuevoarchivo);

                FileUpload1.PostedFile.SaveAs(carpeta_final);
                mst.mostrarMsjNtf(dic.CambiodeImagenAPAD);
                SubirImagenBD(nuevoarchivo);
                Foto(desicion2);
            }
            catch (Exception ex)
            {
                string error = "Error: " + ex.Message;
                mst.mostrarMsjAdvNtf(error);
            }
        }
Beispiel #26
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();
            }
        }
Beispiel #27
0
        protected void btnIngresar_Click(object sender, EventArgs e)
        {
            DateTime fechaCreacion = DateTime.Now;
            String   añoEscolar    = txbAño.Text;
            //String miembro = ddlMiembro.SelectedValue;
            String miembro      = miembroSLCT;
            String notas        = txbNotas.Text;
            String proximoGrado = ddlProximoGrado.SelectedValue;
            //String centroEducProximoGrado = ddlCentroEduc.SelectedValue;
            String estadoEduc     = ddlEstadoEduc.SelectedValue;
            String seccion        = txbSeccion.Text;
            String carrera        = ddlCarreraEduc.SelectedValue;
            int    intAñoEscolar  = Int32.Parse(añoEscolar);
            int    añoActual      = DateTime.Now.Year;
            int    limiteInferior = añoActual - (edadMiembro - 1);
            int    añoSiguiente   = añoActual + 1;

            if ((intAñoEscolar <= añoSiguiente) && (intAñoEscolar >= limiteInferior))
            {
                try
                {
                    if (bdTS.añoVerificarIngreso(S, miembro, añoEscolar))
                    {
                        //DataTable dtAñoSuperior = bdTS.añoObtenerAñoSuperior(S, miembro, añoEscolar);
                        //DataTable dtAñoInferior = bdTS.añoObtenerAñoInferior(S, miembro, añoEscolar);
                        //DataRow drAñoSuperior = dtAñoSuperior.Rows[0];
                        //DataRow drAñoInferior = dtAñoInferior.Rows[0];
                        //int intAñoSuperior = Int32.Parse(drAñoSuperior["Año"].ToString());
                        //String gradoAñoSuperior = drAñoSuperior["Grado"].ToString();
                        //String estadoAñoSuperior = drAñoSuperior["Estado"].ToString();
                        //int intAñoInferior = Int32.Parse(drAñoInferior["Año"].ToString());
                        //String gradoAñoInferior = drAñoInferior["Grado"].ToString();
                        //String estadoAñoInferior = drAñoInferior["Estado"].ToString();
                        //int diferenciaSuperior = estadoEduc.Equals("PERD") ? (intAñoSuperior - intAñoEscolar) : (intAñoSuperior - intAñoEscolar);
                        //int diferenciaInferior = estadoAñoInferior.Equals("PERD") ? (intAñoEscolar - intAñoInferior) : (intAñoEscolar - intAñoInferior);
                        //Boolean esAptoSuperior = bdTS.añoVerificarAñoCronologicamente(diferenciaSuperior, proximoGrado, true, gradoAñoSuperior);
                        //Boolean esAptoInferior = bdTS.añoVerificarAñoCronologicamente(diferenciaInferior + 1, proximoGrado, false, gradoAñoInferior);
                        Boolean esAptoSuperior = true;
                        Boolean esAptoInferior = true;
                        if (esAptoSuperior && esAptoInferior)
                        {
                            bdTS.añoNuevoAño(S, miembro, añoEscolar, U, proximoGrado, estadoEduc, carrera, notas, seccion);
                            prepararPnlInsertar();
                            llenarGdvAñosEscolar();
                            mst.mostrarMsjNtf(dic.msjSeHaIngresado);
                        }
                        else
                        {
                            //if (L.Equals("es"))
                            //{
                            //    mst.mostrarMsjAdv("No apto cronológicamente." + esAptoInferior + " " + diferenciaInferior + " " + gradoAñoInferior + " " + esAptoSuperior + " " + diferenciaSuperior + " " + gradoAñoSuperior);
                            //}
                            //else
                            //{
                            //    mst.mostrarMsjAdv("No apto cronológicamente.");
                            //}
                        }
                    }
                    else
                    {
                        if (L.Equals("es"))
                        {
                            mst.mostrarMsjAdvNtf("Un miembro solo puede tener un Año Escolar por año.");
                        }
                        else
                        {
                            mst.mostrarMsjAdvNtf("A member can only have one School Year per year.");
                        }
                    }
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjMdl(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
            }
            else
            {
                if (L.Equals("es"))
                {
                    mst.mostrarMsjAdvNtf("El Año debe ser entre " + limiteInferior + " y " + añoSiguiente + ".");
                }
                else
                {
                    mst.mostrarMsjAdvNtf("The Year must be between " + limiteInferior + " and " + añoSiguiente + ".");
                }
            }
        }
        protected void accionar(object sender, EventArgs e)
        {
            switch (accionborrar)
            {
            case 2:
                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.mostrarMsjNtf(dic.msjSeHaEliminado);
                sql = "SELECT  CONVERT(nvarchar(30), MA.CreationDateTime, 21) Crea, cdAT.Code Cod,dbo.fn_GEN_FormatDate(MA.ActivityDateTime, 'ES') AS Fecha, cdAT.DescSpanish AS Actividad, MA.Notes AS Observaciones, MA.UserId Usuario FROM dbo.MemberActivity MA INNER JOIN dbo.CdMemberActivityType cdAT ON MA.Type = cdAT.Code WHERE MA.RecordStatus = ' ' AND cdAT.FunctionalArea = 'EDUC' AND MA.Project = '" + S + "' AND YEAR(MA.ActivityDateTime) = " + lblVanio.Text + " AND MA.MemberId = " + M + " ORDER BY MA.CreationDateTime DESC ";
                llenargrid2(sql, gvutiles);
                break;

            case 3:
                sql = "UPDATE dbo.MemberEducationObservation SET RecordStatus = 'H', ExpirationDateTime = GETDATE(), Observation = Observation + ' (" + U + ")' WHERE RecordStatus = ' ' AND IdObservation = " + id + " ";
                APD.ejecutarSQL(sql);
                mst.mostrarMsjNtf(dic.msjSeHaEliminado);
                sql = "SELECT  cdC.DescSpanish AS Categoría, dbo.fn_GEN_FormatDate(MEO.ObservationDateTime, 'ES')  + ' ' + CONVERT(varchar, MEO.ObservationDateTime, 108)  AS Fecha, MEO.Observation AS Observación,  MEO.UserId AS Usuario,  MEO.IdObservation FROM  dbo.MemberEducationObservation MEO INNER JOIN dbo.CdMemberEducObservationCategory cdC ON MEO.Category = cdC.Code WHERE MEO.RecordStatus = ' ' AND MEO.Project = '" + S + "' AND YEAR(MEO.ObservationDateTime) = " + lblVanio.Text + " AND MEO.MemberId = " + M + " ORDER BY MEO.ObservationDateTime DESC ";
                llenargrid2(sql, gvutiles);
                break;

            case 4:
                DataTable listTable = new DataTable();
                sql = "SELECT * FROM dbo.fn_GEN_InfoGenMiembro('" + S + "', " + M + ", " + lblVanio.Text + ") L ";
                LlenarDataTable(sql, listTable);
                string   certificado;
                DateTime actual = DateTime.Now;
                if (chktienecertificado.Checked == true)
                {
                    certificado = "1";
                }
                else
                {
                    certificado = "0";
                }
                sql = "SELECT Code FROM dbo.CdGrade WHERE ValidValue = 1 AND(DescSpanish = '" + listTable.Rows[0]["Grado"].ToString() + "' OR DescEnglish = '" + listTable.Rows[0]["Grado"].ToString() + "') ORDER BY Orden";
                string codigogrado = obtienePalabra(sql, "Code");
                sql = "SELECT Code FROM CdEducationStatus  WHERE ValidValue = 1 AND (DescSpanish='" + listTable.Rows[0]["Estado_Educ"].ToString() + "' OR DescEnglish='" + listTable.Rows[0]["Estado_Educ"].ToString() + "')";
                string codigoestado = obtienePalabra(sql, "Code");
                string carreracodigo;
                if (string.IsNullOrEmpty(ddlcarrera.SelectedValue))
                {
                    carreracodigo = "NULL";
                }
                else
                {
                    carreracodigo = "'" + ddlcarrera.SelectedValue + "'";
                }
                sql = "INSERT INTO  dbo.MemberEducationYear SELECT Project, MemberId, SchoolYear, '" + ddlescuela.SelectedValue + "' SchoolCode, '" + ddlgrado.SelectedValue + "' Grade, GETDATE() CreationDateTime, RecordStatus,'" + U + "' UserId, ExpirationDateTime, ClassSection, PercentOfExpensesToPay, '" + ddlexestado.SelectedValue + "' ReasonNotToContinue, '" + ddlestado.SelectedValue + "' Status, " + carreracodigo + " Career, SingleTeacher, TransportationStartDate, TransportationEndDate, Notes, ExceptionPercent, '" + certificado + "' HasCertificate, NYSPackage, Typing FROM  dbo.MemberEducationYear WHERE RecordStatus = ' ' AND Project = '" + S + "' AND MemberId = " + M + " AND SchoolYear = " + lblVanio.Text + " AND Grade = '" + codigogrado + "' AND Status = '" + codigoestado + "' AND SchoolCode = '" + listTable.Rows[0]["EscuelaId"].ToString() + "'";
                APD.ejecutarSQL(sql);
                //inactiva el historial del record
                sql = "UPDATE dbo.MemberEducationYear SET RecordStatus = 'H', ExpirationDateTime = GETDATE() WHERE  RecordStatus = ' ' AND Project = '" + S + "' AND MemberId = " + M + " AND schoolYear = " + lblVanio.Text + "  AND schoolCode = '" + listTable.Rows[0]["EscuelaId"].ToString() + "' AND grade = '" + codigogrado + "' AND Convert(nvarchar(30), CreationDateTime, 20) = '" + CreationDateL.Text + "' ";
                APD.ejecutarSQL(sql);
                LLenarHistorial();
                tbinfo.Visible      = false;
                gdvAvisos.Visible   = false;
                gvhistorial.Visible = true;
                tbcheques.Visible   = false;
                gvutiles.Visible    = false;
                break;

            default:
                mst.mostrarMsjAdvNtf("Ha ocurrido un error: por fabor cambie de funcion y vuelva a intentar si el problema persiste por fabor informe a sistemas.");
                break;

            case 5:
                DataTable listTable2 = new DataTable();

                sql = "SELECT * FROM dbo.fn_GEN_InfoGenMiembro('" + S + "', " + M + ", " + anioelminar + ") L ";
                LlenarDataTable(sql, listTable2);
                sql = "SELECT Code FROM dbo.CdGrade WHERE ValidValue = 1 AND(DescSpanish = '" + listTable2.Rows[0]["Grado"].ToString() + "' OR DescEnglish = '" + listTable2.Rows[0]["Grado"].ToString() + "') ORDER BY Orden";
                string codigogrado1 = obtienePalabra(sql, "Code");


                sql = "UPDATE dbo.MemberEducationYear SET RecordStatus = 'H', ExpirationDateTime = GETDATE() WHERE  RecordStatus = ' ' AND Project = '" + S + "' AND MemberId = " + M + " AND schoolYear = " + anioelminar + "  AND schoolCode = '" + listTable2.Rows[0]["EscuelaId"].ToString() + "' AND grade = '" + codigogrado1 + "' AND Convert(nvarchar(30), CreationDateTime, 20) = '" + listTable2.Rows[0]["CreationDT"].ToString() + "' ";
                APD.ejecutarSQL(sql);
                //Response.Write(sql);
                LLenarHistorial();
                break;
            }
        }
Beispiel #29
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     guardar();
     mst.mostrarMsjNtf(dic.msjSeHanIngresado);
 }
        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.");
                }
            }
        }