/// <summary> /// 加载项目的功能菜单 /// </summary> /// <param name="context"></param> /// <returns></returns> private string LoadFunMenu(HttpContext context) { StringBuilder sbContent = new StringBuilder(); string strProjectId = CommonMethod.FinalString(context.Request.QueryString["pid"]); string strProductId = CommonMethod.FinalString(context.Request.QueryString["did"]); DataTable dtProjectFunMenu = ProjectFunBusiness.GetFunMenuList(" AND PROJECTID=" + strProjectId); DataRow[] drowCurFun = dtProjectFunMenu.Select(" FMPARENTID=0 ", "FMSORTNUM DESC"); string strChecked = string.Empty; for (int i = 0; i < drowCurFun.Length; i++) { if (strProductId.Length > 0)//修改时判断是否选中 { strChecked = ProductBusiness.IsProductExistFun(strProductId, drowCurFun[i]["FMID"].ToString()) ? "checked='checked'" : ""; } sbContent.Append("<table class=\"table\" style=\"float:left; width:33%; margin-left:3px;\">"); sbContent.AppendFormat("<tr><td class='rhead' style=\"text-align:left;background-image: url('../../Resource/images/searchthead.gif');\" ><input type='checkbox' onclick='CheckAll({1});' name='{0}' id='{1}' value='{1}' {3} />{2}</td></tr>", "fun", drowCurFun[i]["FMID"], drowCurFun[i]["FMNAME"], strChecked); //下面的子菜单 ReConstructionDataRow(dtProjectFunMenu, System.Convert.ToInt32(drowCurFun[i]["FMID"]), sbContent, strProductId, drowCurFun[i]["FMID"].ToString()); sbContent.Append("</table>"); if ((i + 1) % 3 == 0) { sbContent.Append("</br>"); } } return(sbContent.ToString()); }
protected void btnSave_Click(object sender, EventArgs e) { USER_SHARE_FUNMENUMODEL usfModel = null; bool isEdit = FmId > 0 && ActionType.Equals("edit"); bool isSuccess = false; //日志记录 USER_SHARE_LOGMODEL logModel = new USER_SHARE_LOGMODEL(); logModel.LOGID = CommonBusiness.GetSeqID("S_USER_SHARE_LOG"); logModel.OPERATEDATE = DateTime.Now; logModel.OPERATORID = AccountId; logModel.PROJECTID = ProjectId; logModel.COMPANYID = CompanyId; int nProjectId = ValidatorHelper.ToInt(Enc.Decrypt(Request.QueryString["projectid"], UrlEncKey), 0); //新增 if (!isEdit) { usfModel = new USER_SHARE_FUNMENUMODEL(); usfModel.FMID = CommonBusiness.GetSeqID("S_USER_SHARE_FUNMENU"); usfModel.PROJECTID = nProjectId; usfModel.FMPARENTID = FmId > 0 ? FmId : 0; logModel.OPERATETYPE = int.Parse(ShareEnum.LogType.AddProjectFunMenu.ToString("d")); logModel.OPERATECONTENT = "新增项目功能菜单,项目ID:" + usfModel.PROJECTID + ",菜单名称:" + txtFMName.Text.Trim(); } //修改 else { usfModel = ProjectFunBusiness.GetModel(FmId); logModel.OPERATETYPE = int.Parse(ShareEnum.LogType.EditProjectFunMenu.ToString("d")); logModel.OPERATECONTENT = "修改项目功能菜单,菜单ID:" + FmId + ",修改后菜单名称:" + txtFMName.Text.Trim(); } usfModel.FMNAME = txtFMName.Text.Trim(); usfModel.FMPAGEURL = txtFMPageUrl.Text.Trim(); usfModel.FMSORTNUM = ValidatorHelper.ToInt(txtFMSortNum.Text, 0); usfModel.FMDESC = txtFMDesc.Text.Trim(); if (!isEdit) { isSuccess = ProjectFunBusiness.AddProjectFun(usfModel, logModel); } else { isSuccess = ProjectFunBusiness.UpdateProjectFun(usfModel, logModel); } Alert((isEdit ? "修改" : "新增") + "功能菜单" + (isSuccess ? "成功" : "失败,请重试") + "!"); //刷新父页面 ExecStartScript(string.Format("parent.location='ProjectFunManage.aspx?pid={0}&s={1}';", Request.QueryString["projectid"], new Random(10000).Next())); }
private void LoadInfo(int nFmId) { USER_SHARE_FUNMENUMODEL usfModel = ProjectFunBusiness.GetModel(nFmId); if (usfModel != null) { txtFMName.Text = usfModel.FMNAME; txtFMDesc.Text = CommonMethod.FinalString(usfModel.FMDESC); txtFMPageUrl.Text = CommonMethod.FinalString(usfModel.FMPAGEURL); txtFMSortNum.Text = usfModel.FMSORTNUM.ToString(); } }
/// <summary> /// 将功能菜单设置为无效 /// </summary> /// <param name="context"></param> private string DelFunMenu(HttpContext context) { int nFmId = ValidatorHelper.ToInt(Enc.Decrypt(context.Request.QueryString["fmid"], UrlEncKey), 0); //日志记录 USER_SHARE_LOGMODEL logModel = new USER_SHARE_LOGMODEL(); logModel.LOGID = CommonBusiness.GetSeqID("S_USER_SHARE_LOG"); logModel.OPERATEDATE = DateTime.Now; logModel.OPERATORID = AccountId; logModel.PROJECTID = ProjectId; logModel.COMPANYID = CompanyId; logModel.OPERATETYPE = int.Parse(ShareEnum.LogType.ChangeProjectFunMenuStatus.ToString("d")); logModel.OPERATECONTENT = "设置项目功能菜单状态为" + EnumPlus.GetEnumDescription(typeof(ShareEnum.LogType), logModel.OPERATETYPE.ToString()); return(ProjectFunBusiness.SetFunStop(nFmId, logModel) ? "0" : "1"); }
/// <summary> /// 加载项目菜单 /// </summary> /// <param name="context"></param> /// <returns></returns> private string LoadProjectFunMenu(HttpContext context) { string strProjectId = Enc.Decrypt(context.Request.QueryString["projectid"], UrlEncKey); StringBuilder sb = new StringBuilder(); sb.Append("["); if (strProjectId.Length > 0) { DataTable terminate = new DataTable(); terminate.Columns.Add("FMID"); terminate.Columns.Add("FMPARENTID"); terminate.Columns.Add("FMNAME"); terminate.Columns.Add("FMPAGEURL"); terminate.Columns.Add("FMDESC"); terminate.Columns.Add("FMSORTNUM"); DataTable dtProjectFunMenu = ProjectFunBusiness.GetFunMenuList(" AND PROJECTID=" + strProjectId); ReConstructionDataTable(dtProjectFunMenu, terminate, 0); DataRow row; DataRowCollection drc = terminate.Rows; int rowCount = drc.Count; if (rowCount > 0) { for (int i = 0; i < rowCount; i++) { row = drc[i]; sb.Append("["); sb.AppendFormat("{0},{1},", row["FMID"], row["FMPARENTID"]); sb.Append("["); sb.AppendFormat("'{0}','{1}','{2}','{3}','{4}'", row["FMNAME"], row["FMPAGEURL"], row["FMSORTNUM"], row["FMDESC"], Enc.Encrypt(row["FMID"].ToString(), UrlEncKey)); sb.Append("]"); if (i != rowCount - 1) { sb.Append("],"); } else { sb.Append("]"); } } sb.Append("]"); } } return(sb.ToString()); }
/// <summary> /// 判断功能能否被删除 /// </summary> /// <param name="context"></param> /// <returns></returns> private string IfFunDel(HttpContext context) { int nFmId = ValidatorHelper.ToInt(Enc.Decrypt(context.Request.QueryString["fmid"], UrlEncKey), 0); return(ProjectFunBusiness.ExistsChildFun(nFmId) ? "1" : "0"); }