Esempio n. 1
0
        protected void DDLPa_SelectedIndexChanged(object sender, EventArgs e)
        {
            string str = DDLPa.SelectedValue;
            int    i   = Convert.ToInt32(DDLCell.SelectedValue);

            if (i < 10)
            {
                str += "0" + i.ToString();
            }
            else
            {
                str += i.ToString();
            }
            List <RoomModel> list = roombll.GetAllRoomUsed(str);

            if (list.Count != 0)
            {
                DDLRoomID.DataSource = list;
                DDLRoomID.DataBind();
                Panel1.Visible = true;
                Panel2.Visible = false;
            }
            else
            {
                Panel1.Visible = false;
                Panel2.Visible = true;
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     user = (UserModel)Session["User"];
     if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1)
     {
         Response.Redirect("../Login.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             DDLType.DataSource = parkbll.GetBasePark();
             DDLType.DataBind();
             DDLPa.DataSource = pabll.GetAllPavilion();
             DDLPa.DataBind();
             DDLCell.DataSource = typebll.GetType("Cell");
             DDLCell.DataBind();
             string str = DDLPa.SelectedValue;
             int    i   = Convert.ToInt32(DDLCell.SelectedValue);
             if (i < 10)
             {
                 str += "0" + i.ToString();
             }
             else
             {
                 str += i.ToString();
             }
             List <RoomModel> list = roombll.GetAllRoomUsed(str);
             if (list.Count != 0)
             {
                 DDLRoomID.DataSource = list;
                 DDLRoomID.DataBind();
                 Panel1.Visible = true;
                 Panel2.Visible = false;
             }
             else
             {
                 Panel1.Visible = false;
                 Panel2.Visible = true;
             }
         }
     }
 }