protected void InitControls() { this.bName.Text = ""; PaducnSoft.DAL.ay_menu dal_class = new PaducnSoft.DAL.ay_menu(); DataSet dsClass = dal_class.GetList(" and bLocation='-2'"); this.bParent.DataTextField = "bName"; this.bParent.DataValueField = "bId"; this.bParent.DataSource = dsClass; this.bParent.DataBind(); this.bParent.Items.Insert(0, new ListItem("无(作为一级菜单)", "0")); this.bUrl.Text = ""; this.bOpenMode.SelectedValue = "_self"; this.bLocation.Value = "-2"; this.bIsShow.SelectedValue = "1"; this.bOrder.Text = StringPlus.NullToString(dal.GetRecordCount("") + 1); Page.SetFocus(this.bName); }
private void ShowInfo(int bId) { PaducnSoft.DAL.ay_menu dal_class = new PaducnSoft.DAL.ay_menu(); DataSet dsClass = dal_class.GetList(" and bLocation='-2'"); this.bParent.DataTextField = "bName"; this.bParent.DataValueField = "bId"; this.bParent.DataSource = dsClass; this.bParent.DataBind(); this.bParent.Items.Insert(0, new ListItem("无(作为一级菜单)", "0")); PaducnSoft.Model.ay_menu model = dal.GetModel(bId); this.bId.Value = model.bId.ToString(); this.bName.Text = model.bName; this.bUrl.Text = model.bUrl; this.bParent.SelectedValue = model.bParent.ToString(); this.bOpenMode.SelectedValue = model.bOpenMode; this.bLocation.Value = model.bLocation; this.bIsShow.SelectedValue = model.bIsShow.ToString(); this.bOrder.Text = model.bOrder.ToString(); }