protected void Page_Load(object sender, EventArgs e)
    {
        RptCourse.DataSource = Datos.GetHabitacionesDisponibles();
        RptCourse.DataBind();

        RepeaterCheckin.DataSource = Datos.GetHabitacionesCheckin();
        RepeaterCheckin.DataBind();

        Repeaterocu.DataSource = Datos.GetHabitacionesOcupadas();
        Repeaterocu.DataBind();

        RepeaterCkeckout.DataSource = Datos.GetHabitacionesCheckout();
        RepeaterCkeckout.DataBind();

        RepeaterNotas.DataSource = Datos.GetNotas();
        RepeaterNotas.DataBind();

        int permiso;

        try
        {
            permiso = Convert.ToInt32(Session["EMP_ACCESO"].ToString());
        }
        catch
        {
            permiso = 0;
        }
        if (permiso > 3 || permiso < 1)
        {
            //Response.Redirect("../Login.aspx");
        }
        else
        {
            lbluser.Text    = "Conectado ==> " + Session["USER"].ToString();
            lblUsuario.Text = Session["USER"].ToString();
            switch (permiso)
            {
            case 1:
                lbltipo.Text = "Administrador";
                break;

            case 2:
                lbltipo.Text = "Recepcionista";
                break;

            case 3:
                lbltipo.Text = "Recamarera";
                break;

            default:
                break;
            }
        }
        habcheckin();
        habcheckout();
        habocupadas();
        habdisponibles();
    }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <blog_nota> list            = repository.Listar().OrderByDescending(l => l.f_publicacion).ToList();
            UsuarioCompleto  UsuarioCompleto = (UsuarioCompleto)Session["UsuarioCompleto"];

            foreach (var r in list)
            {
                if (r.imagen_nota != null && r.imagen_nota != "")
                {
                    r.imagen_nota = "../../content/img/notas/" + r.imagen_nota;
                }
                else
                {
                    r.imagen_nota = "../../content/img/sin-imagen.jpg";
                }

                if (r.descripcion_nota.Length > 100)
                {
                    r.descripcion_nota = r.descripcion_nota.Substring(0, 100) + "...";
                }
            }

            if (list.Count() > 0)
            {
                RepeaterNotas.DataSource = list;
                RepeaterNotas.DataBind();
            }
            else
            {
                msjNoHayNotas.Text = "No hay notas todavĂ­a";
            }

            if (UsuarioCompleto == null)
            {
                receta.Visible = false;
                nota.Visible   = false;
            }
            else
            {
                if (UsuarioCompleto.Usuario.id_usuario_tipo == 1)
                {
                    nota.Visible   = false;
                    receta.Visible = false;
                }
                else
                {
                    if (UsuarioCompleto.Usuario.id_usuario_tipo == 2)
                    {
                        receta.Visible = false;
                    }
                }
            }
        }
 protected void btnAgregarnota2_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtnotas.Text))
     {
     }
     else
     {
         if (Datos.InsertarNota(txtnotas.Text, Convert.ToInt32(Session["EMP_ID"])))
         {
             RepeaterNotas.DataSource = Datos.GetNotas();
             RepeaterNotas.DataBind();
             txtnotas.Text = "";
         }
         else
         {
         }
     }
 }