private void LoadCompanyGroup()
        {
            DataTable dt = CompanyGroupBusiness.GetCompanyGroupList(" AND COMPANYCODE=" + CompanyCode);

            if (dt != null && dt.Rows.Count > 0)
            {
                InitTree(dt, tvGroups.Nodes, "0");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 加载公司分组
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string LoadCompanyGroup(HttpContext context)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[");

            DataTable terminate = new DataTable();

            terminate.Columns.Add("ID");
            terminate.Columns.Add("PARENTID");
            terminate.Columns.Add("GROUPNAME");
            terminate.Columns.Add("GROUPDESC");
            terminate.Columns.Add("GRADE");

            DataTable dtCompanyGroup = CompanyGroupBusiness.GetCompanyGroupList(" AND COMPANYCODE=" + CompanyCode);

            ReConstructionCompanyGroupDataTable(dtCompanyGroup, 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["ID"], row["PARENTID"]);
                    sb.Append("[");
                    sb.AppendFormat("'{0}','{1}','{2}','{3}'", row["GROUPNAME"], row["GROUPDESC"], Enc.Encrypt(row["ID"].ToString(), UrlEncKey), row["GRADE"]);
                    sb.Append("]");
                    if (i != rowCount - 1)
                    {
                        sb.Append("],");
                    }
                    else
                    {
                        sb.Append("]");
                    }
                }

                sb.Append("]");
            }


            return(sb.ToString());
        }