protected void Acept_cancel_Click(object sender, EventArgs e)
        {
            //se hace el proceso de cancelar la inscripcion}
            string    sql      = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion AS ID_Condicionn, Alumno.Apellido, Alumno.Nombre, Mesa.Fecha AS Fechas, Mesa.Hora AS Horas, Estados.Nombre AS Estado, Condiciom.Descripcion AS Condicion, Mesa.ID_Materia, Materia.Nombre AS Materia, Mesa.ID_ProfesorTitular, Materia.ID_Profesor, Inscripcion.Confirmado, Inscripcion.Cancelado FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado INNER JOIN Condiciom ON Inscripcion.ID_Condicion = Condiciom.ID_Condicion INNER JOIN Materia ON Mesa.ID_Materia = Materia.ID_Materia where Confirmado = 0 and Cancelado = 0";
            AdminDB   db       = new AdminDB();
            DataTable t        = db.procesarselect(sql);
            int       alum     = int.Parse(t.Rows[0]["ID_Alumno"].ToString());
            int       IDincrip = int.Parse(Request.QueryString["cancelar"]);
            bool      r        = db.Poner_Motivo(TextBoxMotivo.Text, IDincrip);

            if (r == true)
            {
                //se obtuvo el id del alumno para luego conseguir el mail
                string    sql2   = "select * from Alumno where ID_Alumno =" + alum;
                DataTable y      = db.procesarselect(sql2);
                string    correo = y.Rows[0]["Mail"].ToString();
                string    motivo = t.Rows[0]["Observaciones"].ToString();
                string    mesa   = t.Rows[0]["Descripcion"].ToString();
                //se le hace le envio del mail
                //mostrando en el mail el motivo recien agregado
                CCorreo objcorreo = new CCorreo(correo, "Aviso de Cancelacion", "Se te a Cancelado la inscripciona a la mesa " + mesa + " el motivo de dicha cancelacion es :" + motivo);
                if (objcorreo.Estado)
                {
                    Response.Write("");
                }
                else
                {
                    Response.Write("");
                }
            }
            else
            {
                Label1.Text = "No se pudo cancelar la inscripcion ";
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IniciarllenadoDrop();
            }

            //se consigue el ID del usuario ingresado
            int       user = (int)Session["ID_User"];
            string    sql  = "select * from Usuarios where ID_Usuario =" + user.ToString();
            AdminDB   db   = new AdminDB();
            DataTable t    = db.procesarselect(sql);
            int       tipo = int.Parse(t.Rows[0]["ID_Tipo_Usuario"].ToString());

            if (tipo == 3)
            {
            }

            this.divnuevains.Visible = false;

            //se actualizan los datos de los dropdown y los textboxs a los del seleccionado a editar
            if (!IsPostBack)
            {
                if (Request.QueryString["idmesa"] != null)
                {
                    int       mesa = int.Parse(Request.QueryString["idmesa"]);
                    string    SQL  = "select * from Mesa where ID_Mesa =" + mesa;
                    AdminDB   DB   = new AdminDB();
                    DataTable y    = DB.procesarselect(SQL);
                    this.dividinscripciones.Visible = false;
                    this.divnuevains.Visible        = true;
                    DropMesMesa.SelectedValue       = y.Rows[0]["ID_MesMesa"].ToString();
                    DropMesa.SelectedValue          = y.Rows[0]["ID_Materia"].ToString();
                    DropMesMesa.Enabled             = false;
                    DropMesa.Enabled = false;
                }
                else
                {
                    this.divnuevains.Visible = false;
                }
            }

            //se establece en el dropdown que el mes de la mesa sea mayor a la fecha actual
            string    sql1 = "select * from MesMesa where Fecha_Iscripcion_Hasta > '" + DateTime.Today.ToShortDateString() + "'";
            DataTable i    = db.procesarselect(sql1);

            if (i.Rows.Count > 0)
            {
                DropMesMesa.Enabled = false;
                DropMesMesa.ClearSelection();
                Label3.Visible = false;
                //int limite = int.Parse(i.Rows[0]["ID_MesMesa"].ToString());
                //DropMesMesa.SelectedValue = limite.ToString();
            }
            else
            {
            }
        }
Пример #3
0
        protected void Guardarins_Click(object sender, EventArgs e)
        {
            AdminDB   db   = new AdminDB();
            int       ID   = (int)Session["ID_User"];
            string    sql4 = "select * from Alumno where ID_Usuario = " + ID;
            DataTable o    = db.procesarselect(sql4);
            int       ida  = int.Parse(o.Rows[0]["ID_ALumno"].ToString());

            if (DropMesMesa.Enabled == true)
            {
                bool r = db.Insert_Inscripcion(TextBox1.Text, DateTime.Now.ToShortTimeString(), int.Parse(DropMesa.SelectedValue), ida, 1, " ", int.Parse(DropDownList3.SelectedValue), ID);
                //int.Parse(DropDownList2.SelectedValue)
                if (r == true)
                {
                    string    mail    = "select * from Alumno where ID_Usuario =" + ID;
                    DataTable t       = db.procesarselect(mail);
                    string    correo  = t.Rows[0]["Mail"].ToString();
                    string    sql     = "select Top(1)* from Inscripcion order by ID_Inscripcion Desc";
                    DataTable y       = db.procesarselect(sql);
                    int       idmesa  = int.Parse(y.Rows[0]["ID_Mesa"].ToString());
                    string    sql2    = "select * from Mesa where ID_Mesa =" + idmesa;
                    DataTable u       = db.procesarselect(sql2);
                    int       idmat   = int.Parse(u.Rows[0]["ID_Materia"].ToString());
                    string    fecha   = u.Rows[0]["Fecha"].ToString();
                    string    sql3    = "Select * from Materia where ID_Materia =" + idmat;
                    DataTable i       = db.procesarselect(sql3);
                    string    materia = i.Rows[0]["Nombre"].ToString();
                    Convert.ToDateTime(fecha).ToShortDateString();
                    CCorreo objcorreo = new CCorreo(correo, "Aviso de Inscripcion", "Se ha inscripto a la mesa de " + materia + " la fecha de la mesa es " + fecha + ", su estado de inscripcion es Pre-Inscrpto, espere a ser aprobado");
                    if (objcorreo.Estado)
                    {
                        Response.Write("");
                    }
                    else
                    {
                        Response.Write("");
                    }
                    //this.dividinscripciones.Visible = true;
                    //Response.Redirect("Inscripciones.aspx");
                }
                else
                {
                    Label2.Visible = true;
                }
            }
            else
            {
                Label4.Visible = true;
                Label5.Visible = true;
                Label5.Text    = "Asegurese de que la fecha este dentro de la fecha de examen seleccionada ";
            }
        }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.nuevafecha.Visible    = false;
     this.mesMesa.Visible       = true;
     this.editarmesmesa.Visible = false;
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string    SQL = "SELECT MesMesa.ID_MesMesa AS Expr1, MesMesa.Descripcion AS Expr2, MesMesa.ID_Carrera AS Expr3, MesMesa.Fecha_Inscripcion_Desde AS Expr4, MesMesa.Fecha_Iscripcion_Hasta AS Expr5, Carrera.Nombre, MesMesa.* FROM MesMesa INNER JOIN Carrera ON MesMesa.ID_Carrera = Carrera.ID_Carrera where ID_MesMesa=" + Request.QueryString["id"];
             AdminDB   DB  = new AdminDB();
             DataTable t   = DB.procesarselect(SQL);
             //this.divmesa.Attributes.Add("style", "display:none");
             this.mesMesa.Visible       = false;
             this.editarmesmesa.Visible = true;
             TextBox10.Text             = Convert.ToDateTime(t.Rows[0]["Fecha_Inicio_Mesa_Hasta"].ToString()).ToString("dd-MM-yyyy");
             TextBox9.Text = Convert.ToDateTime(t.Rows[0]["Fecha_Inicio_Mesa_Desde"].ToString()).ToString("dd-MM-yyyy");
             TextBox8.Text = Convert.ToDateTime(t.Rows[0]["Fecha_Confirm_incrip_Hasta"].ToString()).ToString("dd-MM-yyyy");
             TextBox7.Text = Convert.ToDateTime(t.Rows[0]["Fecha_Confirm_incrip_Desde"].ToString()).ToString("dd-MM-yyyy");
             TextBox6.Text = Convert.ToDateTime(t.Rows[0]["Fecha_Iscripcion_Hasta"].ToString()).ToString("dd-MM-yyyy");
             TextBox5.Text = Convert.ToDateTime(t.Rows[0]["Fecha_Inscripcion_Desde"].ToString()).ToString("dd-MM-yyyy");
             TextBox4.Text = t.Rows[0]["Descripcion"].ToString();
             DropDownList2.SelectedValue = t.Rows[0]["ID_Carrera"].ToString();
         }
         else
         {
             this.editarmesmesa.Visible = false;
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            AdminDB   db = new AdminDB();
            DataTable t  = db.procesarselect("SELECT dbo.MesMesa.Descripcion AS Mesa, dbo.Materia.Nombre AS Materia, dbo.Mesa.Fecha, dbo.Mesa.Hora, p.Apellido AS Titular, pp.Apellido AS Vocal1, ppp.Apellido AS Vocal2, dbo.Mesa.ID_Mesa, dbo.MesMesa.ID_MesMesa FROM dbo.Mesa INNER JOIN dbo.MesMesa ON dbo.Mesa.ID_MesMesa = dbo.MesMesa.ID_MesMesa INNER JOIN dbo.Materia ON dbo.Mesa.ID_Materia = dbo.Materia.ID_Materia INNER JOIN dbo.Profesor AS p ON p.ID_Profesor = dbo.Mesa.ID_ProfesorTitular INNER JOIN dbo.Profesor AS pp ON pp.ID_Profesor = dbo.Mesa.ID_ProfesorVocal1 INNER JOIN dbo.Profesor AS ppp ON ppp.ID_Profesor = dbo.Mesa.ID_ProfesorVocal2");

            for (int i = 0; i < t.Rows.Count; i++)
            {
                //if(t.Rows[i]["ID_MesMesa"] == )
                //{

                Label1.Text += "<table class='ble table-bordered'>";
                Label1.Text += "<thead>";
                Label1.Text += "<tr>";
                Label1.Text += "<td colspan='3'>" + t.Rows[0]["Mesa"] + "</td>";
                Label1.Text += "</tr>";
                Label1.Text += "</thead>";
                Label1.Text += "<tbody>";
                Label1.Text += "<tr>";
                Label1.Text += "<td>" + t.Rows[0]["Materia"] + "</td>";
                Label1.Text += "<td>" + t.Rows[0]["Fecha"] + "<br/>" + t.Rows[0]["Hora"] + "</td>";
                Label1.Text += "<td>" + t.Rows[0]["Titular"] + " " + t.Rows[0]["Vocal1"] + " " + t.Rows[0]["Vocal2"] + "</td>";
                Label1.Text += "</tbody>";
                Label1.Text += "</table>";

                //}
            }
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.divnuevoalumno.Visible = false;
     this.editaralumno.Visible   = false;
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string    SQL = "select * from Alumno where ID_Alumno=" + Request.QueryString["id"];
             AdminDB   DB  = new AdminDB();
             DataTable t   = DB.procesarselect(SQL);
             this.editaralumno.Visible = true;
             this.divalumnos.Visible   = false;
             TextBox7.Text             = t.Rows[0]["Nombre"].ToString();
             TextBox8.Text             = t.Rows[0]["Apellido"].ToString();
             TextBox9.Text             = t.Rows[0]["DNI"].ToString();
             TextBox10.Text            = t.Rows[0]["Mail"].ToString();
             TextBox11.Text            = t.Rows[0]["Celular"].ToString();
             DropCarreEd.SelectedValue = t.Rows[0]["ID_Carrera"].ToString();
         }
         else
         {
             this.editaralumno.Visible = false;
         }
     }
 }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.divmesa.Visible        = true;
     this.divnuevamesa.Visible   = false;
     this.diceditarmesas.Visible = false;
     if (!IsPostBack)
     {
         IniciarllenadoDrops();
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string    SQL = "select * from Mesa where ID_Mesa=" + Request.QueryString["id"];
             AdminDB   DB  = new AdminDB();
             DataTable t   = DB.procesarselect(SQL);
             this.divmesa.Visible        = false;
             this.diceditarmesas.Visible = true;
             TextBox2.Text = Convert.ToDateTime(t.Rows[0]["Fecha"].ToString()).ToString("dd/MM/yyyy");
             TextBox3.Text = t.Rows[0]["Hora"].ToString();
             TextBox1.Text = t.Rows[0]["Descripcion"].ToString();
             DropDownList1.SelectedValue = t.Rows[0]["ID_Materia"].ToString();
             DropDownList2.SelectedValue = t.Rows[0]["ID_MesMesa"].ToString();
             DropDownList3.SelectedValue = t.Rows[0]["ID_ProfesorTitular"].ToString();
             DropDownList4.SelectedValue = t.Rows[0]["ID_ProfesorVocal1"].ToString();
             DropDownList5.SelectedValue = t.Rows[0]["ID_ProfesorVocal2"].ToString();
         }
         else
         {
             this.diceditarmesas.Visible = false;
         }
     }
 }
Пример #8
0
        protected void Iniciar_Click1(object sender, EventArgs e)
        {
            string    sql = "select * from Usuarios where Usuario ='" + UsuarioTBox.Text + "' and Contraseña = '" + ContraseñaTBox.Text + "'";
            AdminDB   db  = new AdminDB();
            DataTable t   = db.procesarselect(sql);


            if (t != null)
            {
                if (t.Rows.Count > 0)
                {
                    int IDTipo = int.Parse(t.Rows[0]["ID_Tipo_Usuario"].ToString());
                    int ID     = int.Parse(t.Rows[0]["ID_Usuario"].ToString());
                    Session.Add("ID_User", ID);
                    Session.Add("ID_Tipo", IDTipo);
                    Response.Redirect("Menu.aspx");
                }
                else
                {
                    Label1.Visible      = true;
                    UsuarioTBox.Text    = "";
                    ContraseñaTBox.Text = "";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //se le consigue el ID de usuario del profesor
            //acorde del ID del profesor se le muestran las inscripciones en las que el es titular
            int       user  = (int)Session["ID_User"];
            string    sql   = "select * from Profesor where ID_Usuario =" + user.ToString();
            AdminDB   db    = new AdminDB();
            DataTable y     = db.procesarselect(sql);
            int       idpro = int.Parse(y.Rows[0]["ID_Usuario"].ToString());
            DataTable u     = db.procesarselect("select * from Profesor where ID_Usuario =" + idpro);
            int       id    = int.Parse(u.Rows[0]["ID_Profesor"].ToString());
            string    mesa  = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion AS ID_Condicionn, Alumno.Apellido, Alumno.Nombre, Mesa.Fecha AS Fechas, Mesa.Hora AS Horas, Estados.Nombre AS Estado, Condiciom.Descripcion AS Condicion, Mesa.ID_Materia, Materia.Nombre AS Materia, Mesa.ID_ProfesorTitular, Materia.ID_Profesor FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado INNER JOIN Condiciom ON Inscripcion.ID_Condicion = Condiciom.ID_Condicion INNER JOIN Materia ON Mesa.ID_Materia = Materia.ID_Materia where Inscripcion.Confirmado = 0 and Inscripcion.Cancelado = 0 and Mesa.ID_ProfesorTitular =" + id;

            SqlDataSource1.SelectCommand = mesa;

            this.cancelar.Visible = false;

            //al seleccionar confirmar se le muestra los drops para editarlos
            if (!IsPostBack)
            {
                if (Request.QueryString["confirmar"] != null)
                {
                    string    SQL = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion AS ID_Condicionn, Alumno.Apellido + ' ' + Alumno.Nombre as ApellidoNombre, Alumno.Nombre, Mesa.Fecha AS Fechas, Mesa.Hora AS Horas, Mesa.Descripcion, Estados.Nombre AS Estado, Condiciom.Descripcion AS Expr1 FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado INNER JOIN Condiciom ON Inscripcion.ID_Condicion = Condiciom.ID_Condicion where ID_Inscripcion=" + Request.QueryString["confirmar"];
                    AdminDB   DB  = new AdminDB();
                    DataTable t   = DB.procesarselect(SQL);
                    this.inscripciones.Visible  = false;
                    this.confirminscrip.Visible = true;
                    TextBox1.Text = t.Rows[0]["ApellidoNombre"].ToString();
                    //TextBox3.Text = t.Rows[0]["Apellido"].ToString();
                    TextBox4.Text = t.Rows[0]["Horas"].ToString();
                    TextBox5.Text = t.Rows[0]["Fechas"].ToString();
                    TextBox6.Text = t.Rows[0]["Descripcion"].ToString();
                    DropDownList1.SelectedValue = t.Rows[0]["ID_Condicionn"].ToString();
                }
                else
                {
                    this.confirminscrip.Visible = false;
                }

                if (Request.QueryString["cancelar"] != null)
                {
                    this.inscripciones.Visible = false;
                    this.cancelar.Visible      = true;
                }
            }
        }
        protected void SeleccionarMesMesa(object sender, EventArgs e)
        {
            //se hace el llenado del dropdown Mesa a corde de lo que se selcciono en el dropdown MesMesa
            AdminDB db        = new AdminDB();
            int     MesMesaID = Convert.ToInt32(DropMesMesa.SelectedValue);

            DropMesa.DataSource     = db.procesarselect("SELECT Mesa.ID_Mesa, Mesa.Descripcion, Mesa.ID_Materia, Mesa.Fecha, Mesa.Hora, Mesa.ID_MesMesa, Mesa.ID_ProfesorTitular, Mesa.ID_ProfesorVocal1, Mesa.ID_ProfesorVocal2, Materia.ID_Carrera, MesMesa.ID_MesMesa AS Expr1, Materia.Nombre FROM Mesa INNER JOIN Materia ON Mesa.ID_Materia = Materia.ID_Materia INNER JOIN MesMesa ON Mesa.ID_MesMesa = MesMesa.ID_MesMesa where Mesa.ID_MesMesa =" + MesMesaID);
            DropMesa.DataTextField  = "Nombre";
            DropMesa.DataValueField = "ID_Mesa";
            DropMesa.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int       user = (int)Session["ID_User"];
            string    sql  = "select ID_Alumno from Alumno where ID_Usuario =" + user.ToString();
            AdminDB   db   = new AdminDB();
            DataTable y    = db.procesarselect(sql);
            int       idal = int.Parse(y.Rows[0]["ID_Alumno"].ToString());
            string    mesa = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion AS ID_Condicionn, Alumno.Apellido, Alumno.Nombre, Mesa.Fecha AS Fechas, Mesa.Hora AS Horas, Estados.Nombre AS Estado, Condiciom.Descripcion AS Condicion, Mesa.ID_Materia, Materia.Nombre AS Materia, Mesa.ID_ProfesorTitular, Materia.ID_Profesor FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado INNER JOIN Condiciom ON Inscripcion.ID_Condicion = Condiciom.ID_Condicion INNER JOIN Materia ON Mesa.ID_Materia = Materia.ID_Materia where Inscripcion.ID_Usuario =" + user;

            SqlDataSource1.SelectCommand = mesa;
        }
        protected void SeleccionarVocal1(object sender, EventArgs e)
        {
            //se pone que el Drop de profe vocal2 no tenga el profe seleccionado en el Drop de profe vocal1
            AdminDB db      = new AdminDB();
            int     ProfeID = Convert.ToInt32(DropProfeVocal1.SelectedValue);

            DropProfeVocal2.DataSource     = db.procesarselect("select ID_Profesor, Profesor.Apellido + ' ' + Profesor.Nombre as NombreApellido from Profesor where Profesor.ID_Profesor !=" + ProfeID);
            DropProfeVocal2.DataTextField  = "NombreApellido";
            DropProfeVocal2.DataValueField = "ID_Profesor";
            DropProfeVocal2.DataBind();
        }
Пример #13
0
        protected void SeleccionarMateria(object sender, EventArgs e)
        {
            //se hace el llenado del dropdown Profesor Titular a corde de lo que se selcciono en el dropdown Materia
            AdminDB db        = new AdminDB();
            int     MateriaID = Convert.ToInt32(Materia_alta_mesa.SelectedValue);

            Prof_titular_altamesa.DataSource     = db.procesarselect("select Profesor.ID_Profesor, Profesor.Apellido + ' ' + Profesor.Nombre as NombreApellido,Materia.Nombre, Materia.ID_Profesor as ID_Prof, Materia.ID_Materia from Profesor join Materia on Profesor.ID_Profesor = Materia.ID_Profesor where Materia.ID_Materia =" + MateriaID);
            Prof_titular_altamesa.DataTextField  = "NombreApellido";
            Prof_titular_altamesa.DataValueField = "ID_Profesor";
            Prof_titular_altamesa.DataBind();
            Prof_titular_altamesa.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
        }
Пример #14
0
        private void IniciarllenadoDrops()
        {
            AdminDB db = new AdminDB();

            Materia_alta_mesa.DataSource     = db.procesarselect("SELECT [ID_Materia], [Nombre] FROM [Materia]");
            Materia_alta_mesa.DataTextField  = "Nombre";
            Materia_alta_mesa.DataValueField = "ID_Materia";
            Materia_alta_mesa.DataBind();
            //Se le agrega al principio del dropdown un Item seleccionar
            Materia_alta_mesa.Items.Insert(0, new ListItem("[Seleccionar una Materia]", "0"));
            Prof_titular_altamesa.Items.Insert(0, new ListItem("[Seleccionar un Profesor]", "0"));
        }
        protected void SeleccionarMateria(object sender, EventArgs e)
        {
            //se ejecuta el metodo SeleccionarMateria
            //se pone que el profesor titular se el que dicta la materia
            AdminDB db        = new AdminDB();
            int     MateriaID = Convert.ToInt32(DropMateria.SelectedValue);

            DropProfeTitular.DataSource     = db.procesarselect("select Profesor.ID_Profesor, Profesor.Apellido + ' ' + Profesor.Nombre as NombreApellido,Materia.Nombre, Materia.ID_Profesor as ID_Prof, Materia.ID_Materia from Profesor join Materia on Profesor.ID_Profesor = Materia.ID_Profesor where Materia.ID_Materia =" + MateriaID);
            DropProfeTitular.DataTextField  = "NombreApellido";
            DropProfeTitular.DataValueField = "ID_Profesor";
            DropProfeTitular.DataBind();
        }
Пример #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int       user  = (int)Session["ID_User"];
            string    sql   = "select * from Usuarios where ID_Usuario =" + user;
            AdminDB   db    = new AdminDB();
            DataTable t     = db.procesarselect(sql);
            int       idusu = int.Parse(t.Rows[0]["ID_Usuario"].ToString());
            string    prof  = "select * from Profesor where ID_Usuario =" + idusu;
            DataTable y     = db.procesarselect(prof);
            //if (y != null)
            //{
            int    idpro = int.Parse(y.Rows[0]["ID_Profesor"].ToString());
            string sql1  = "SELECT Mesa_Examen.Mesa, Mesa_Examen.Materia, Mesa_Examen.Fecha, Mesa_Examen.Hora, Mesa_Examen.Titular, Mesa_Examen.Vocal1, Mesa_Examen.Vocal2, Mesa_Examen.ID_Mesa, Mesa.ID_Materia, MesMesa.ID_Carrera, Carrera.Nombre FROM Mesa_Examen INNER JOIN Mesa ON Mesa_Examen.ID_Mesa = Mesa.ID_Mesa INNER JOIN MesMesa ON Mesa.ID_MesMesa = MesMesa.ID_MesMesa INNER JOIN Carrera ON MesMesa.ID_Carrera = Carrera.ID_Carrera  where ID_ProfesorTitular =" + idpro + " ORDER BY Mesa_Examen.Fecha DESC";

            SqlDataSource1.SelectCommand = sql1;
            //}
            //else
            //{
            //Label1.Text = "Usted no tiene mesas asiganda hasta el momento";
            //}
        }
Пример #17
0
        private void IniciarllenadoDrop()
        {
            AdminDB db = new AdminDB();

            DropMesMesa.DataSource     = db.procesarselect("Select * from MesMesa");
            DropMesMesa.DataTextField  = "Descripcion";
            DropMesMesa.DataValueField = "ID_MesMesa";
            DropMesMesa.DataBind();
            //Se le agrega al principio del dropdown un Item seleccionar
            DropMesMesa.Items.Insert(0, new ListItem("[Seleccionar una Fecha de Examen]", "0"));
            DropMesa.Items.Insert(0, new ListItem("[Seleccionar una Mesa]", "0"));
        }
        protected void Acep_confirm_Click(object sender, EventArgs e)
        {
            //se hace el proceso de confimar la inscripcion
            string    sql    = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion AS ID_Condicionn, Alumno.Apellido + ' ' + Alumno.Nombre as ApellidoNombre, Alumno.Nombre, Mesa.Fecha AS Fechas, Mesa.Hora AS Horas, Mesa.Descripcion, Estados.Nombre AS Estado, Condiciom.Descripcion AS Expr1 FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado INNER JOIN Condiciom ON Inscripcion.ID_Condicion = Condiciom.ID_Condicion where ID_Inscripcion=" + Request.QueryString["confirmar"];
            AdminDB   db     = new AdminDB();
            DataTable t      = db.procesarselect(sql);
            int       estado = int.Parse(t.Rows[0]["ID_Estado"].ToString());
            int       alum   = int.Parse(t.Rows[0]["ID_Alumno"].ToString());
            //se obtuvo el id del alumno para luego conseguir el mail
            string    sql2      = "select * from Alumno where ID_Alumno =" + alum;
            DataTable y         = db.procesarselect(sql2);
            string    correo    = y.Rows[0]["Mail"].ToString();
            int       idinscrip = int.Parse(Request.QueryString["confirmar"]);
            string    mesa      = t.Rows[0]["Descripcion"].ToString();
            bool      r         = db.Cambiar_Condicion(int.Parse(DropDownList1.SelectedValue), idinscrip);

            if (correo != null)
            {
                if (r == true)
                {
                    //se le hace le envio del mail avisando que le confirmo su incripcion a la mesa
                    CCorreo objcorreo = new CCorreo(correo, "Aviso de Confirmacion", "Se te a aprobado la inscripcion a la mesa " + mesa);
                    if (objcorreo.Estado)
                    {
                        Response.Write("");
                    }
                    else
                    {
                        Response.Write("");
                    }
                }
                else
                {
                    Label1.Text = "No se pudo cambiar el estado del alumno ";
                }
            }
            else
            {
            }
        }
        private void IniciarllenadoDrop()
        {
            //Se hace el llenado de los datos del dropdown de MesMesa
            AdminDB db = new AdminDB();

            DropMesMesa.DataSource     = db.procesarselect("Select * from MesMesa "); //where Fecha_Iscripcion_Hasta > '" + DateTime.Today.ToShortDateString() + "'");
            DropMesMesa.DataTextField  = "Descripcion";
            DropMesMesa.DataValueField = "ID_MesMesa";
            DropMesMesa.DataBind();
            //Se le agrega al principio del dropdown un Item seleccionar
            DropMesMesa.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
            DropMesa.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
        }
Пример #20
0
        protected void Nuevains_Click(object sender, EventArgs e)
        {
            //se hace el proceso de una nueva inscripcion
            this.divnuevains.Visible        = true;
            this.dividinscripciones.Visible = false;
            TextBox1.Text = DateTime.Today.ToShortDateString();
            int       user = (int)Session["ID_User"];
            string    sql  = "select * from Usuarios where ID_Usuario =" + user.ToString();
            AdminDB   db   = new AdminDB();
            DataTable t    = db.procesarselect(sql);
            int       tipo = int.Parse(t.Rows[0]["ID_Tipo_Usuario"].ToString());

            if (tipo == 3)
            {
                string    sql1 = "select * from Alumno where ID_Usuario  =" + user;
                DataTable y    = db.procesarselect(sql1);
                //DropDownList1.SelectedValue = y.Rows[0]["ID_Carrera"].ToString();
                //DropDownList2.SelectedValue = y.Rows[0]["ID_Alumno.Apellido"].ToString();
                DropMesa.Enabled      = false;
                DropDownList2.Enabled = false;
            }
            Response.Redirect("Nueva-Inscripcion.aspx");
        }
        private void IniciarllenadoDrops()
        {
            //se llenan el Drop de la Materia
            AdminDB db = new AdminDB();

            DropMateria.DataSource     = db.procesarselect("SELECT [ID_Materia], [Nombre] FROM [Materia]");
            DropMateria.DataTextField  = "Nombre";
            DropMateria.DataValueField = "ID_Materia";
            DropMateria.DataBind();
            //se llena el drop de el profesor vocal
            DropProfeVocal1.DataSource     = db.procesarselect("select ID_Profesor, Profesor.Apellido + ' ' + Profesor.Nombre as NombreApellido from Profesor");
            DropProfeVocal1.DataTextField  = "NombreApellido";
            DropProfeVocal1.DataValueField = "ID_Profesor";
            DropProfeVocal1.DataBind();
            //se llena el drop de el profesor vocal 2
            DropProfeVocal2.DataSource     = db.procesarselect("select ID_Profesor, Profesor.Apellido + ' ' + Profesor.Nombre as NombreApellido from Profesor");
            DropProfeVocal2.DataTextField  = "NombreApellido";
            DropProfeVocal2.DataValueField = "ID_Profesor";
            DropProfeVocal2.DataBind();
            //Se le agrega al principio del dropdown un Item seleccionar
            DropMateria.Items.Insert(0, new ListItem("[Seleccionar una Materia]", "0"));
            DropProfeTitular.Items.Insert(0, new ListItem("[Seleccionar un Profesor]", "0"));
        }
Пример #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AdminDB   db       = new AdminDB();
            int       user     = (int)Session["ID_User"];
            string    sql      = "select * from Alumno where ID_Usuario =" + user;
            DataTable t        = db.procesarselect(sql);
            string    nombre   = t.Rows[0]["Nombre"].ToString();
            string    apellido = t.Rows[0]["Apellido"].ToString();

            Label1.Text = "" + nombre + " " + apellido;

            string fecha = "SELECT Mesa_Examen.Mesa, Mesa_Examen.Materia, Mesa_Examen.Fecha, Mesa_Examen.Hora, Mesa_Examen.Titular, Mesa_Examen.Vocal1, Mesa_Examen.Vocal2, Mesa_Examen.ID_Mesa, Mesa.ID_Materia, MesMesa.ID_Carrera FROM Mesa_Examen INNER JOIN Mesa ON Mesa_Examen.ID_Mesa = Mesa.ID_Mesa INNER JOIN MesMesa ON Mesa.ID_MesMesa = MesMesa.ID_MesMesa where Mesa.Fecha > '" + DateTime.Today.ToShortDateString() + "' ORDER BY Mesa_Examen.Fecha DESC";

            SqlDataSource1.SelectCommand = fecha;
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IniciarllenadoDrop();
            }
            TextBoxFecha.Text = DateTime.Today.ToShortDateString();
            int       user = (int)Session["ID_User"];
            string    sql  = "select * from Usuarios where ID_Usuario =" + user.ToString();
            AdminDB   db   = new AdminDB();
            DataTable t    = db.procesarselect(sql);
            int       tipo = int.Parse(t.Rows[0]["ID_Tipo_Usuario"].ToString());

            if (tipo == 3)
            {
                string    sql1 = "select * from Alumno where ID_Usuario  =" + user;
                DataTable y    = db.procesarselect(sql1);
                //DropDownList1.SelectedValue = y.Rows[0]["ID_Carrera"].ToString();
                //DropDownList2.SelectedValue = y.Rows[0]["ID_Alumno.Apellido"].ToString();
                DropMesa.Enabled   = false;
                DropAlumno.Enabled = false;
            }

            //se establece en el dropdown que el mes de la mesa sea mayor a la fecha actual
            string    sql2 = "select * from MesMesa where Fecha_Iscripcion_Hasta > '" + DateTime.Today.ToShortDateString() + "'";
            DataTable i    = db.procesarselect(sql2);

            if (i.Rows.Count == 0)
            {
                DropMesMesa.Enabled = false;
                DropMesMesa.ClearSelection();
                LabelLimite.Text = "No hay fechas de exmanes en los siguientes meses";
                //int limite = int.Parse(i.Rows[0]["ID_MesMesa"].ToString());
                //DropMesMesa.SelectedValue = limite.ToString();
            }
        }
Пример #24
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            AdminDB   db    = new AdminDB();
            string    sql   = "Select * from Inscripcion";
            DataTable t     = db.procesarselect(sql);
            int       conta = 0;
            int       y     = int.Parse(TextBox1.Text);

            for (int i = 0; i < t.Rows.Count; i++)
            {
                int u = int.Parse(t.Rows[i]["ID_Alumno"].ToString());
                if (u == y)
                {
                    conta       = conta + 1;
                    Label1.Text = conta.ToString();
                    int       b    = int.Parse(t.Rows[i]["ID_Mesa"].ToString());
                    string    sql1 = "select * from Mesa_Examen where ID_Mesa =" + b;
                    DataTable a    = db.procesarselect("select * from Mesa_Examen where ID_Mesa =" + b);
                    Label2.Text += " <div class='card'>";
                    Label2.Text += "<h5 class='card-header'>" + a.Rows[0]["Fecha"].ToString() + "</h5>";
                    Label2.Text += "<div class='card-body'>";
                    Label2.Text += "<h5 class='card-title'>" + a.Rows[0]["Titular"].ToString() + "</h5>";
                    Label2.Text += "<p class='card-text'>" + " - " + a.Rows[0]["Vocal1"].ToString() + " - " + a.Rows[0]["Vocal2"].ToString() + " - " + a.Rows[0]["Materia"].ToString() + "</p>";
                    Label2.Text += "</div>";
                    Label2.Text += "</div>";

                    /*
                     * Label2.Text = Label2.Text + " - " + a.Rows[0]["Fecha"].ToString();
                     * Label3.Text = Label3.Text + " - " + a.Rows[0]["Titular"].ToString();
                     * Label4.Text = Label4.Text + " - " + a.Rows[0]["Vocal1"].ToString();
                     * Label5.Text = Label5.Text + " - " + a.Rows[0]["Vocal2"].ToString();
                     * Label6.Text = Label6.Text + " - " + a.Rows[0]["Materia"].ToString();
                     */
                }
            }
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.divnuevacarrera.Visible  = false;
            this.divnuevamateria.Visible  = false;
            this.diveditarmateria.Visible = false;
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string    SQL = "select * from Materia where ID_Materia=" + Request.QueryString["id"];
                    AdminDB   DB  = new AdminDB();
                    DataTable t   = DB.procesarselect(SQL);
                    this.divmaterias.Visible      = false;
                    this.diveditarmateria.Visible = true;
                    DropDownList5.SelectedValue   = t.Rows[0]["ID_Profesor"].ToString();
                    DropDownList2.SelectedValue   = t.Rows[0]["ID_Carrera"].ToString();
                    DropDownList3.SelectedValue   = t.Rows[0]["Curso"].ToString();
                    TextBoxNomMatE.Text           = t.Rows[0]["Nombre"].ToString();
                }

                else
                {
                    this.diveditarmateria.Visible = false;
                }

                if (Request.QueryString["id2"] != null)
                {
                    string    SQL = "select * from Carrera where ID_Carrera=" + Request.QueryString["id2"];
                    AdminDB   DB  = new AdminDB();
                    DataTable t   = DB.procesarselect(SQL);
                    this.divmaterias.Visible      = false;
                    this.diveditarmateria.Visible = false;
                    this.diveditcarrera.Visible   = true;
                    TextBoxNomCarre.Text          = t.Rows[0]["Nombre"].ToString();
                }

                else
                {
                    this.diveditcarrera.Visible = false;
                }
            }
        }
Пример #26
0
        protected void Iniciar_Click(object sender, EventArgs e)
        {
            string    sql = "select * from Alumno where Nombre ='" + TextBox1.Text + "' and DNI = '" + TextBox2.Text + "' and Aprobado = 0";
            AdminDB   db  = new AdminDB();
            DataTable t   = db.procesarselect(sql);


            if (t != null)
            {
                if (t.Rows.Count > 0)
                {
                    int ID = int.Parse(t.Rows[0]["ID_Usuario"].ToString());
                    Session.Add("ID_User", ID);
                    Response.Redirect("Menu.aspx");
                }
                else
                {
                    //Label1.Visible = true;
                }
            }
        }
Пример #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.alumno.Visible = false;
            int       user = (int)Session["ID_User"];
            string    sql  = "select * from Usuarios where ID_Usuario =" + user.ToString();
            AdminDB   db   = new AdminDB();
            DataTable t    = db.procesarselect(sql);
            int       tipo = int.Parse(t.Rows[0]["ID_Tipo_Usuario"].ToString());

            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    this.alumno.Visible = true;
                    string sql1 = "SELECT Inscripcion.ID_Inscripcion, Inscripcion.ID_Usuario, Inscripcion.Hora, Inscripcion.ID_Mesa, Inscripcion.ID_Alumno, Inscripcion.ID_Estado, Inscripcion.Obsevaciones, Inscripcion.ID_Condicion, Inscripcion.Fecha, Alumno.Apellido, Alumno.Nombre, Mesa.Fecha AS Expr1, Mesa.Hora AS Expr2, Mesa.Descripcion, Estados.Nombre AS Expr3 FROM Inscripcion INNER JOIN Alumno ON Inscripcion.ID_Alumno = Alumno.ID_Alumno INNER JOIN Mesa ON Inscripcion.ID_Mesa = Mesa.ID_Mesa INNER JOIN Estados ON Inscripcion.ID_Estado = Estados.ID_Estado where Inscripcion.ID_Usuario = " + Request.QueryString["id"] + " and Mesa.Fecha > '" + DateTime.Today.ToShortDateString() + "'";
                    SqlDataSource2.SelectCommand = sql1;
                }
                else
                {
                }
            }
        }
Пример #28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.divaltaprofesor.Visible = false;
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string    SQL = "select * from Profesor where ID_Profesor=" + Request.QueryString["id"];
             AdminDB   DB  = new AdminDB();
             DataTable t   = DB.procesarselect(SQL);
             this.editarprofesor.Visible = true;
             this.divprofesor.Visible    = false;
             TextBox2.Text = t.Rows[0]["Apellido"].ToString();
             TextBox3.Text = t.Rows[0]["Telefono"].ToString();
             TextBox1.Text = t.Rows[0]["Nombre"].ToString();
             TextBox4.Text = t.Rows[0]["DNI"].ToString();
             TextBox5.Text = t.Rows[0]["Mail"].ToString();
         }
         else
         {
             this.editarprofesor.Visible = false;
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            TextBoxFecha.Text = DateTime.Today.ToShortDateString();
            if (!IsPostBack)
            {
                IniciarllenadoDrop();
            }

            if (!IsPostBack)
            {
                if (Request.QueryString["idmesa"] != null)
                {
                    int       mesa = int.Parse(Request.QueryString["idmesa"]);
                    string    SQL  = "select * from Mesa where ID_Mesa =" + mesa;
                    AdminDB   DB   = new AdminDB();
                    DataTable y    = DB.procesarselect(SQL);
                    DropMesMesa.SelectedValue = y.Rows[0]["ID_MesMesa"].ToString();
                    DropMesa.SelectedValue    = y.Rows[0]["ID_Materia"].ToString();
                    DropMesMesa.Enabled       = false;
                    DropMesa.Enabled          = false;
                }
            }
            //se establece en el dropdown que el mes de la mesa sea mayor a la fecha actual
            AdminDB   db   = new AdminDB();
            string    sql2 = "select * from MesMesa "; //where Fecha_Iscripcion_Hasta > '" + DateTime.Today.ToShortDateString() + "'";
            DataTable i    = db.procesarselect(sql2);

            if (i.Rows.Count == 0)
            {
                DropMesMesa.Enabled = false;
                DropMesMesa.ClearSelection();
                LabelLimite.Text = "No hay fechas de exmanes en los siguientes meses";
                //int limite = int.Parse(i.Rows[0]["ID_MesMesa"].ToString());
                //DropMesMesa.SelectedValue = limite.ToString();
            }
        }
Пример #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.elejir.Visible          = false;
     this.divNuevoUsuario.Visible = false;
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string    SQL = "select * from Usuarios where ID_Usuario=" + Request.QueryString["id"];
             AdminDB   DB  = new AdminDB();
             DataTable t   = DB.procesarselect(SQL);
             this.divEditarUsuario.Visible = true;
             this.divusuarios.Visible      = false;
             TextBox2.Text = t.Rows[0]["Contraseña"].ToString();
             TextBox3.Text = t.Rows[0]["Mail"].ToString();
             TextBox1.Text = t.Rows[0]["Usuario"].ToString();
             DropDownList1.SelectedValue = t.Rows[0]["ID_Tipo_Usuario"].ToString();
         }
         else
         {
             this.divEditarUsuario.Visible = false;
         }
     }
 }