Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            btnAceptar.Attributes["onclick"] = "return Confirmacion();";
            Label11.Text = Session["Uni"].ToString();
            Label12.Text = Session["Cedula"].ToString();
            Label16.Text = DateTime.Now.ToShortDateString();
            GridView2.Visible = false;
            LinkButton1.Visible = false;
            try
            {
                DataSet1TableAdapters.ClasesTableAdapter adapter = new DataSet1TableAdapters.ClasesTableAdapter();
                DataSet1TableAdapters.Clientes1TableAdapter adapter2 = new DataSet1TableAdapters.Clientes1TableAdapter();

                Label13.Text = cbxClase.SelectedValue;
                DataRow row1 = adapter.ObtenerDatos(Label11.Text, Convert.ToInt32(cbxClase.SelectedValue)).Rows[0];

                Label15.Text = row1["Dia"].ToString();
                Label20.Text = cbxClase.SelectedItem.ToString();
                Label24.Text = row1["Hora"].ToString();

                DataRow row2 = adapter2.GetData(cbxAlumna.SelectedValue).Rows[0];
                Label18.Text = row1["Nivel"].ToString();
            }
            catch(Exception ex)
            {
            }
        }
Beispiel #2
0
 protected void cbxAlumna_SelectedIndexChanged(object sender, EventArgs e)
 {
     DataSet1TableAdapters.Clientes1TableAdapter adapter = new DataSet1TableAdapters.Clientes1TableAdapter();
     try
     {
         DataRow row1 = adapter.GetData(cbxAlumna.SelectedValue).Rows[0];
         Label18.Text = row1["Nivel"].ToString();
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #3
0
        protected void Boton1_Click(object sender, EventArgs e)
        {
            DataSet1TableAdapters.RolesTableAdapter adapter = new DataSet1TableAdapters.RolesTableAdapter();
            DataSet1TableAdapters.Clientes1TableAdapter adapter2 = new DataSet1TableAdapters.Clientes1TableAdapter();
            DataSet1TableAdapters.Clases_InscritasTableAdapter adapter3 = new DataSet1TableAdapters.Clases_InscritasTableAdapter();
            DataSet1TableAdapters.ClasesTableAdapter adapter4 = new DataSet1TableAdapters.ClasesTableAdapter();
            DataSet1TableAdapters.Clientes1TableAdapter adapter12 = new DataSet1TableAdapters.Clientes1TableAdapter();
            try
            {
                DataRow row = adapter.GetPerfil(TextBox1.Text, TextBox2.Text).Rows[0];
                //string perfil = row["perfil"].ToString();
                Session["Perfil"] = row["perfil"].ToString();

                try
                {
                    DataRow row1 = adapter.GetPerfil(TextBox1.Text, TextBox2.Text).Rows[0];
                    //RegistroDatos.Tienda.cedula = row1["usuario"].ToString();
                    Session["Cedula"] = row1["usuario"].ToString();
                    DataRow row2 = adapter12.GetData(TextBox1.Text).Rows[0];
                    //RegistroDatos.Tienda.usuario = row2["Nombre"].ToString();
                    Session["Nombre"] = row2["Nombre"].ToString();
                    //RegistroDatos.Tienda.unidad = row2["UnidadDeNegocio"].ToString();
                    Session["Unidad"] = row2["UnidadDeNegocio"].ToString();
                    //clases = row2["ClasesActivas"].ToString();
                    Session["ClasesActivas"] = row2["ClasesActivas"].ToString();
                }catch(Exception ex)
                {

                }
                if (Session["Perfil"].Equals("Admin"))
                {
                    //Tienda.administrador = "Admin";
                    Session["Administrador"] = "Admin";
                    //Tienda.panel = true;
                    Session["Panel"] = true;
                    //Tienda.grid1 = true;
                    Session["Grid1"] = true;
                    //Tienda.grid2 = false;
                    Session["Grid2"] = false;
                    //Tienda.grid3 = true;
                    Session["Grid3"] = true;
                    //Tienda.hip1 = true;
                    Session["Hip1"] = true;
                    //Tienda.hip2 = false;
                    Session["Hip2"] = false;

                    Response.Redirect("Administrador.aspx");
                }
                else
                {
                    if (Session["Perfil"].Equals("user"))
                    {

                        DataTable table = adapter3.ObtenerTodo();
                        string fecha = "";
                        DateTime fech;
                        string nombre;
                        string fechaClase;
                        string hora;
                        string nombreI;
                        string fechaClaseI;
                        string horaI;
                        string docente;
                        string docenteExiste = "";

                        foreach (DataRow row3 in table.Rows)
                        {
                            fecha = row3["Fecha"].ToString();
                            fech = Convert.ToDateTime(fecha);
                            nombre = row3["Nombre"].ToString();
                            hora = row3["Hora"].ToString();

                                if (fech.Year <= DateTime.Now.Year)
                                {
                                    if (fech.Month < DateTime.Now.Month)
                                    {
                                        adapter3.ActualizarClase(1, TextBox1.Text, fecha, hora);
                                    }
                                    else
                                    {
                                        if (fech.Day < DateTime.Now.Day)
                                        {
                                            adapter3.ActualizarClase(1, TextBox1.Text, fecha, hora);
                                        }
                                    }
                                }

                        }
                        Response.Redirect("Alumnas.aspx");
                    }
                    else
                    {
                        if (Session["Perfil"].Equals("DocenL") || Session["Perfil"].Equals("DocenS") || Session["Perfil"].Equals("DocenP"))
                        {
                            if (Session["Perfil"].Equals("DocenL"))
                                //Tienda.uni = "Licsu";
                                Session["Uni"] = "Licsu";
                            if (Session["Perfil"].Equals("DocenS"))
                                //Tienda.uni = "Sura";
                                Session["Uni"] = "Sura";
                            if (Session["Perfil"].Equals("DocenP"))
                                //Tienda.uni = "Proteccion";
                                Session["Uni"] = "Proteccion";
                            Response.Redirect("Docentes.aspx");
                        }
                        if (Session["Perfil"].Equals("AdminL"))
                        {
                            //Tienda.panel = false;
                            Session["Panel"] = false;
                            //Tienda.uni = "Licsu";
                            Session["Uni"] = "Licsu";
                            //Tienda.administrador = "AdminL";
                            Session["Administrador"] = "AdminL";
                            //Tienda.docente = "DocenL";
                            Session["Docente"] = "DocenL";
                            //Tienda.grid2 = true;
                            Session["Grid2"] = true;
                            //Tienda.grid1 = false;
                            Session["Grid1"] = false;
                            //Tienda.grid3 = false;
                            Session["Grid3"] = false;
                            //Tienda.hip1 = false;
                            Session["Hip1"] = false;
                            //Tienda.hip2 = true;
                            Session["Hip2"] = true;
                            Response.Redirect("Administradores.aspx");
                        }
                        if (Session["Perfil"].Equals("AdminS"))
                        {
                            //Tienda.panel = false;
                            Session["Panel"] = false;
                            //Tienda.uni = "Sura";
                            Session["Uni"] = "Sura";
                            //Tienda.administrador = "AdmiS";
                            Session["Administrador"] = "AdminS";
                            //Tienda.docente = "DocenS";
                            Session["Docente"] = "DocenS";
                            //Tienda.grid2 = true;
                            Session["Grid2"] = true;
                            //Tienda.grid1 = false;
                            Session["Grid1"] = false;
                            //Tienda.grid3 = false;
                            Session["Grid3"] = false;
                            Session["Hip1"] = false;
                            //Tienda.hip2 = true;
                            Session["Hip2"] = true;
                            Response.Redirect("Administradores.aspx");
                        }
                        if (Session["Perfil"].Equals("AdminP"))
                        {
                            //Tienda.panel = false;
                            Session["Panel"] = false;
                            //Tienda.uni = "Proteccion";
                            Session["Uni"] = "Proteccion";
                            //Tienda.administrador = "Adminp";
                            Session["Administrador"] = "AdminP";
                            //Tienda.docente = "DocenP";
                            Session["Docente"] = "DocenP";
                            //Tienda.grid2 = true;
                            Session["Grid2"] = true;
                            //Tienda.grid1 = false;
                            Session["Grid1"] = false;
                            //Tienda.grid3 = false;
                            Session["Grid3"] = false;
                            Session["Hip1"] = false;
                            //Tienda.hip2 = true;
                            Session["Hip2"] = true;
                            Response.Redirect("Administradores.aspx");
                        }
                    }
                }

            }
            catch (System.IndexOutOfRangeException ex)
            {
                lblValidado.Text = "Usuario y/o contraseña invalidos";
                lblValidado.ForeColor = System.Drawing.Color.Red;
                lblValidado.Visible = true;
                TextBox1.Text = "";
                TextBox2.Text = "";
            }
        }