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();
    }
Exemplo n.º 2
0
        /// <summary>
        /// Repeater data binding method.
        /// </summary>
        /// <param name="crTable"></param>
        private void BindRepeater()
        {
            clsEligibilityDBAccess oclsEligibilityDBAccess = new clsEligibilityDBAccess();

            crTable = oclsEligibilityDBAccess.GetStudentsCourseProfile(uniID, year, studentID);
            if (crTable != null && crTable.Rows.Count > 0)
            {
                RptCourse.DataSource = crTable;
                RptCourse.DataBind();
                divCourseProfile.Visible = true;
            }
            else
            {
                divCourseProfile.Visible = false;
            }
        }
        /// <summary>
        /// Repeater data binding method.
        /// </summary>
        /// <param name="crTable"></param>
        public void BindRepeater()
        {
            clsEligibilityDBAccess oclsEligibilityDBAccess = new clsEligibilityDBAccess();

            crTable = oclsEligibilityDBAccess.GetStudentsCourseProfileForCancelAdmission(uniID, year, studentID);

            if (crTable != null && crTable.Rows.Count > 0)
            {
                RptCourse.DataSource = crTable;
                RptCourse.DataBind();
                divCourseProfile.Visible = true;
                divCourse.Visible        = true;
                hid_Term_Count.Value     = crTable.Rows.Count.ToString();
            }
            else
            {
                divCourseProfile.Visible = false;
                divCourse.Visible        = false;
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        int permiso;

        try
        {
            permiso = Convert.ToInt32(Session["EMP_ACCESO"].ToString());
        }
        catch
        {
            permiso = 0;
        }
        if (permiso > 3 || permiso < 1)
        {
            Response.Redirect("../Login.aspx");
        }
        else
        {
            lblUsuario.Text = Session["USER"].ToString();
            lbluser.Text    = "Conectado ==> " + 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;
            }
        }
        RptCourse.DataSource = Datos.GetCourses();
        RptCourse.DataBind();
    }
        /// <summary>
        /// Rendering profile details
        /// </summary>
        /// <param name="studDs"></param>
        private void RenderTable(DataSet studDs)
        {
            #region "Reset Tables"
            ResetTable(TBLSummery);
            #endregion

            #region Summary
            //
            //Add columns to table Summary
            //
            TableCell oTD = null;
            foreach (DataRow Row in studDs.Tables[0].Rows)
            {
                foreach (DataColumn Field in studDs.Tables[0].Columns)
                {
                    switch (Field.ColumnName)
                    {
                    case "PRN":
                        oTD          = new TableCell();
                        oTD.CssClass = "clOn";
                        oTD.Text     = "<div>" + Convert.ToString(Row[Field.ColumnName]) + "</div>";
                        oTD.Attributes.Add("id", Row["Student_ID"].ToString());
                        TBLSummery.Rows[0].Cells.Add(oTD);
                        break;

                    case "Student_Name":
                        oTD          = new TableCell();
                        oTD.CssClass = "clOn";
                        oTD.Text     = "<div>" + Convert.ToString(Row[Field.ColumnName]) + "</div>";
                        oTD.Attributes.Add("id", Row["Student_ID"].ToString());
                        TBLSummery.Rows[1].Cells.Add(oTD);
                        break;

                    case "Photosign":
                        oTD               = new TableCell();
                        oTD.CssClass      = "clOn";
                        oTD.VerticalAlign = VerticalAlign.Middle;
                        System.Web.UI.WebControls.Image oPhoto = new System.Web.UI.WebControls.Image();
                        oPhoto.ID = "imgPhoto" + Row["Student_ID"].ToString();
                        System.Web.UI.WebControls.Image oSign = new System.Web.UI.WebControls.Image();
                        oSign.ID = "imgSign" + Row["Student_ID"].ToString();
                        //Modified as per Req 102312
                        if (oCDNKeys != null)
                        {
                            objCDN          = new clsCDN(oCDNKeys.PhotoSignKey);
                            sPathExists     = !string.IsNullOrEmpty(Convert.ToString(Row["PhotoPath"])) ? "Y" : "N";
                            oPhoto.ImageUrl = objCDN.PhotoSignDisplay(Convert.ToString(Row["PhotoPath"]), sPathExists, "P");
                            sPathExists     = !string.IsNullOrEmpty(Convert.ToString(Row["SignPath"])) ? "Y" : "N";
                            oSign.ImageUrl  = objCDN.PhotoSignDisplay(Convert.ToString(Row["SignPath"]), sPathExists, "S");
                        }
                        oPhoto.CssClass = "cssImage";
                        //oSign.ImageUrl = dtRow["Download_Path"].ToString() + Row["SignPath"].ToString();//"PhotoSignHandler.ashx?img=Sign&UniID=" + Convert.ToString(Row["pk_Uni_ID"]) + "&StudentID=" + Convert.ToString(Row["pk_Student_ID"]) + "&YearID=" + Convert.ToString(Row["pk_Year"]);
                        oSign.CssClass = "cssImage";
                        oTD.Controls.Add(oPhoto);
                        oTD.Controls.Add(oSign);
                        oTD.Attributes.Add("id", Row["Student_ID"].ToString());
                        TBLSummery.Rows[2].Cells.Add(oTD);
                        break;

                    default: break;
                    }
                }
            }
            #endregion

            #region Course
            if (studDs.Tables[1] != null && studDs.Tables[1].Rows.Count > 0)
            {
                RptCourse.DataSource = studDs.Tables[1];
                RptCourse.DataBind();
                divCourseProfile.Visible = true;
                divCourse.Visible        = true;
                hid_Term_Count.Value     = studDs.Tables[1].Rows.Count.ToString();
            }
            else
            {
                divCourseProfile.Visible = false;
                divCourse.Visible        = false;
            }
            #endregion
        }
 protected void LinkButton1_Click(object sender, EventArgs e)
 {
     RptCourse.DataSource = Datos.GetCourses(txtbuscar.Text);
     RptCourse.DataBind();
 }
 protected void txtbuscar_TextChanged(object sender, EventArgs e)
 {
     RptCourse.DataSource = Datos.GetCourses(txtbuscar.Text);
     RptCourse.DataBind();
 }