Esempio n. 1
0
        /// <summary>
        /// 加载公司的功能菜单信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string LoadCompanyFunMenu(HttpContext context)
        {
            StringBuilder sbContent    = new StringBuilder();
            string        strRoleId    = CommonMethod.FinalString(context.Request.QueryString["Roleid"]);
            string        strProjectId = CommonMethod.FinalString(context.Request.QueryString["ProjectId"]);
            string        strWhere     = string.Format(" AND PROJECTID={0} AND COMPANYID={1} ", strProjectId, CompanyId);

            DataTable dtCompanyFunMenu = CompanyFunBusiness.GetCompanyFunList(strWhere);

            DataRow[] drowCurFun = dtCompanyFunMenu.Select(" CFPARENTID=0 ", "CFSORTNUM DESC");

            string strChecked = string.Empty;

            for (int i = 0; i < drowCurFun.Length; i++)
            {
                if (strRoleId.Length > 0)//修改时判断是否选中
                {
                    strChecked = CompanyFunBusiness.IsRoleExistFun(strRoleId, drowCurFun[i]["CFID"].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]["CFID"], drowCurFun[i]["CFANOTHERNAME"], strChecked);

                //下面的子菜单
                GetCompanyChildFun(dtCompanyFunMenu, System.Convert.ToInt32(drowCurFun[i]["FMID"]), sbContent, strRoleId, drowCurFun[i]["CFID"].ToString());

                sbContent.Append("</table>");
                if ((i + 1) % 3 == 0)
                {
                    sbContent.Append("</br>");
                }
            }
            return(sbContent.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// 加载项目菜单
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string LoadCFunMenu(HttpContext context)
        {
            string        strProjectId = context.Request.QueryString["projectid"];
            StringBuilder sb           = new StringBuilder();

            sb.Append("[");
            if (strProjectId.Length > 0)
            {
                DataTable terminate = new DataTable();
                terminate.Columns.Add("FMID");
                terminate.Columns.Add("CFPARENTID");
                terminate.Columns.Add("CFANOTHERNAME");
                terminate.Columns.Add("CFPAGEURL");
                terminate.Columns.Add("CFDESC");
                terminate.Columns.Add("CFSORTNUM");

                DataTable dtProjectFunMenu = CompanyFunBusiness.GetCompanyFunList(" AND PROJECTID=" + strProjectId + " AND COMPANYID=" + CompanyId);
                ReConstructionCompanyFunDataTable(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["CFPARENTID"]);
                        sb.Append("[");
                        sb.AppendFormat("'{0}','{1}','{2}','{3}','{4}'", row["CFANOTHERNAME"], row["CFPAGEURL"], row["CFSORTNUM"], row["CFDESC"], Enc.Encrypt(row["FMID"].ToString(), UrlEncKey));
                        sb.Append("]");
                        if (i != rowCount - 1)
                        {
                            sb.Append("],");
                        }
                        else
                        {
                            sb.Append("]");
                        }
                    }

                    sb.Append("]");
                }
            }
            return(sb.ToString());
        }