/// <summary> /// 为menu实体赋值 /// </summary> protected void BuildModel() { string menUserCode = string.Empty; if (string.IsNullOrEmpty(Request.QueryString["menuID"])) { menUserCode = menuBll.BuildMenuID(); } else { menUserCode = Request.QueryString["menuID"].Trim(); } menuModel.DisplayOrder = Convert.ToDecimal(txtDisplayOrder.Text.Trim()); //显示顺序 menuModel.FunctionID = string.Empty; //功能编号现在还没有用途 menuModel.IcValue = txtICValue.Text.Trim(); //图片地址 menuModel.IsLeaf = chkIsLeaf.Checked ? "1" : "0"; //是否为叶菜单项 menuModel.IsPop = chkIsPop.Checked ? "1" : "0"; //是否弹出 menuModel.MenuUrl = chkIsLeaf.Checked ? txtMenuAction.Text.Trim() : string.Empty; //菜单活动 menuModel.MenuID = menUserCode; //菜单项编号 //menuModel.MenuLabel = txtMenuLabel.Text.Trim(); //菜单项标签 menuModel.MenuName = txtMenuName.Text.Trim(); //菜单项名称 if (ddlParents.SelectedValue == "0") { menuModel.RootID = "0"; //菜单项为根时,根编号为0 menuModel.ParentsID = "0"; //菜单项为根时,父编号为0 menuModel.MenuSeq = menUserCode; //菜单项为根时,序号为本身编号 menuModel.MenuLevel = "0"; //菜单项为根时,菜单项级别为0 } else { menuModel.ParentsID = ddlParents.SelectedValue; menuModel.MenuSeq = menuBll.GetParentSEQ(ddlParents.SelectedValue) + "." + menUserCode; menuModel.MenuLevel = (menuBll.GetMenuLevel(ddlParents.SelectedValue) + 1).ToString(); menuModel.RootID = menuModel.MenuSeq.Substring(0, 5); } }