Exemplo n.º 1
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 = bll.GetCodeTable();
             DDLType.DataBind();
             CodeGridView.DataSource = bll.GetTypeByID(Convert.ToInt32(DDLType.SelectedValue));
             CodeGridView.DataBind();
         }
     }
 }
Exemplo 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;
             }
         }
     }
 }
Exemplo n.º 3
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();
             int           id       = int.Parse(Request.QueryString["ID"]);
             HomeParkModel homePark = bll.GetHomeParkByID(id);
             lbCell.Text           = homePark.RoomID;
             DDLType.SelectedValue = homePark.ParkID.ToString();
             txtCarID.Text         = homePark.CarID;
             txtType.Text          = homePark.Type;
             txtColor.Text         = homePark.Color;
             txtBuyDate.Value      = homePark.BuyDate.ToString("yyyy-MM-dd");
         }
     }
 }