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) { DDLRoomFormat.DataSource = bll.GetType("RoomFormat"); DDLRoomFormat.DataBind(); DDLSunny.DataSource = bll.GetType("Sunny"); DDLSunny.DataBind(); DDLRoomUse.DataSource = bll.GetType("RoomUse"); DDLRoomUse.DataBind(); DDLIndoor.DataSource = bll.GetType("Indoor"); DDLIndoor.DataBind(); string code = Request.QueryString["ID"].ToString(); RoomModel room = roombll.GetRoomByID(code); lbCode.Text = room.Code; lbRoomID.Text = room.RoomID; lbPaName.Text = room.PaName; txtBuildArea.Text = room.BuildArea.ToString(); txtUseArea.Text = room.UseArea.ToString(); DDLRoomFormat.SelectedValue = room.RoomFormatID.ToString(); DDLSunny.SelectedValue = room.SunnyID.ToString(); DDLRoomUse.SelectedValue = room.RoomUseID.ToString(); DDLIndoor.SelectedValue = room.IndoorID.ToString(); } } }
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) { DDLPa.DataSource = pabll.GetAllPavilion(); DDLPa.DataBind(); DDLCell.DataSource = bll.GetType("Cell"); DDLCell.DataBind(); DDLLayerBegin.Items.Clear(); DDLLayerEnd.Items.Clear(); PavilionModel pavilion = pabll.GetPavilionByID(DDLPa.SelectedValue); for (int i = 1; i <= pavilion.Layer; i++) { ListItem items = new ListItem(); items.Text = i.ToString(); if (i < 10) { items.Value = "0" + i.ToString(); } else { items.Value = i.ToString(); } DDLLayerBegin.Items.Add(items); DDLLayerEnd.Items.Add(items); } DDLLayerBegin.DataBind(); DDLLayerEnd.DataBind(); if (dttable.Columns.Count == 0) { dttable.Columns.Add("ID", typeof(int)); dttable.Columns.Add("SunnyID", typeof(int)); dttable.Columns.Add("SunnyName", typeof(string)); dttable.Columns.Add("IndoorID", typeof(int)); dttable.Columns.Add("IndoorName", typeof(string)); dttable.Columns.Add("RoomUseID", typeof(int)); dttable.Columns.Add("RoomUseName", typeof(string)); dttable.Columns.Add("RoomFormatID", typeof(int)); dttable.Columns.Add("RoomFormatName", typeof(string)); dttable.Columns.Add("BuildArea", typeof(double)); dttable.Columns.Add("UseArea", typeof(double)); DataColumn[] key = { dttable.Columns["ID"] }; dttable.PrimaryKey = key; } } } }
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) { DDLPavilionType.DataSource = bll.GetType("Pavilion"); DDLPavilionType.DataBind(); string paID = Request.QueryString["ID"].ToString(); PavilionModel pavilion = pabll.GetPavilionByID(paID); txtPavilionName.Text = pavilion.Name; txtPavilionLayer.Text = pavilion.Layer.ToString(); txtPavilionHeight.Text = pavilion.Height.ToString(); txtPavilionArea.Text = pavilion.Area.ToString(); txtBuildDate.Value = pavilion.BuildDate.ToString("yyyy-MM-dd"); DDLPavilionType.SelectedValue = pavilion.TypeID.ToString(); txtMemo.Text = pavilion.Memo; } } }
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) { DDLPa.DataSource = pabll.GetAllPavilion(); DDLCell.DataSource = bll.GetType("Cell"); DDLSunny.DataSource = bll.GetType("Sunny"); DDLUse.DataSource = bll.GetType("RoomUse"); DDLFormat.DataSource = bll.GetType("RoomFormat"); DDLIndoor.DataSource = bll.GetType("Indoor"); RoomGridView.DataSource = roombll.GetAllRoom(); DataBind(); } } }
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) { DDLAreaType.DataSource = bll.GetType("AreaFact"); DDLAreaType.DataBind(); } } }
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; } } } }
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) { int id = int.Parse(Request.QueryString["ID"]); DDLAreaType.DataSource = bll.GetType("AreaFact"); DDLAreaType.DataBind(); AreaFactModel areafact = afbll.GetAreaFactByID(id); txtFactName.Text = areafact.FactName; txtMainHead.Text = areafact.MainHead; DDLAreaType.SelectedValue = areafact.TypeID.ToString(); txtTelphone.Text = areafact.Tel; ftbMemo.Text = areafact.Memo; } } }