protected void Page_Load(object sender, EventArgs e) { string action = Request.Params["Action"]; switch (action) { case "Save": Save(); break; } //类别绑定 HD.Data.Common common = new HD.Data.Common(); ddlClass.Items.Clear(); ddlClass.DataSource = common.TClass(); ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ID"; ddlClass.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string Action = Request.Params["Action"]; switch (Action) { case "Edit": EditTerminal(); break; } if (!IsPostBack) { #region 当前页面赋值 string guid = Request.Params["guid"]; terPage = Request.Params["page"]; startTime = Request.Params["StartTime"]; endTime = Request.Params["EndTime"]; selectType = Request.Params["SelectType"]; keyWord = Request.Params["Keyword"]; if (!string.IsNullOrEmpty(guid)) { terminalGuid = guid; Hashtable ht = new Hashtable(); ht.Add("Guid", guid); HD.Model.Terminal terminal = HD.Model.Terminal.Instance.GetModelById(ht); terminal.SetWebControls(this.Page); terminalId = terminal.Id.ToString(); _locationCoordinate = terminal.LocationCoordinate; Manufacturer.SelectedValue = terminal.Manufacturer; MachineSize.SelectedValue = terminal.MachineSize; Screen.SelectedValue = terminal.Screen; Area.SelectedValue = terminal.Area; OpenTime.SelectedValue = terminal.OpenTime; System.SelectedValue = terminal.System; OutIn.SelectedValue = terminal.OutIn.ToString(); if (!string.IsNullOrEmpty(terminal.SignIn)) { SignIn.SelectedValue = terminal.SignIn.ToString(); } Status.SelectedIndex = Convert.ToInt32(terminal.Status); //Status.SelectedValue = terminal.Status.ToString(); PostTime.Text = Convert.ToDateTime(terminal.PostTime).ToString("yyyy-MM-dd"); //图片附件 DataTable dt = DataFactory.GetInstance(). ExecuteTable("select * from wzrb_source where TerGuid='" + guid + "'"); if (dt != null && dt.Rows.Count > 0) { scwOthers.DataSource = dt; scwOthers.DataBind(); } //类别绑定 HD.Data.Common common = new HD.Data.Common(); ddlClass.Items.Clear(); ddlClass.DataSource = common.TClass(); ddlClass.DataTextField = "ClassName"; ddlClass.DataValueField = "ID"; ddlClass.DataBind(); ddlClass.SelectedValue = terminal.ClassID; } #endregion } }