Ejemplo n.º 1
0
        public static int GetPBSUnitFloorCount(string PBSUnitCode)
        {
            int num2;

            try
            {
                int num = 0;
                BuildingStrategyBuilder builder = new BuildingStrategyBuilder();
                builder.AddStrategy(new Strategy(BuildingStrategyName.PBSUnitCode, PBSUnitCode));
                builder.AddOrder("FloorCount", false);
                QueryAgent agent = new QueryAgent();
                agent.SetTopNumber(1);
                string    queryString = builder.BuildMainQueryString();
                DataTable table       = agent.ExecSqlForDataSet(queryString).Tables[0];
                if (table.Rows.Count > 0)
                {
                    num = ConvertRule.ToInt(table.Rows[0]["IFloorCount"]);
                }
                agent.Dispose();
                num2 = num;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num2);
        }
Ejemplo n.º 2
0
        private void LoadDataGrid()
        {
            string projectCode = Request["ProjectCode"] + "";

            try
            {
                //面积字段
                string BuildingAreaFieldName = BLL.CostRule.GetApportionAreaField(projectCode);
                string BuildingAreaFieldDesc = BLL.ProductRule.GetBuildingAreaFieldDesc(BuildingAreaFieldName);
                ((System.Web.UI.WebControls.TemplateColumn)dgList.Columns[4]).HeaderText = BuildingAreaFieldDesc + "(平米)";

                BuildingStrategyBuilder sb = new BuildingStrategyBuilder();

                sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, projectCode));
                sb.AddStrategy(new Strategy(BuildingStrategyName.IsArea, "2"));

                sb.AddOrder("BuildingName", true);

                string sql = sb.BuildQueryViewString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("Building", sql);
                qa.Dispose();

                string[]  arrField = { "RoomArea", "TotalCost" };
                decimal[] arrSum   = BLL.MathRule.SumColumn(entity.CurrentTable, arrField);

                ViewState["SumArea"] = BLL.StringRule.BuildShowNumberString(arrSum[0]);
                ViewState["SumCost"] = BLL.StringRule.BuildShowNumberString(arrSum[1]);

                DataTable tb = entity.CurrentTable;
                BLL.PaymentRule.AddBuildingCBVoucherCode(tb);

                //填面积
                foreach (DataRow dr in tb.Rows)
                {
                    dr["Area"] = dr[BuildingAreaFieldName];
                }

                dgList.DataSource = tb;
                dgList.DataBind();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "显示数据出错:" + ex.Message));
            }
        }
Ejemplo n.º 3
0
        private void LoadDataGrid()
        {
            try
            {
                BuildingStrategyBuilder sb = new BuildingStrategyBuilder();

                string ProjectCode = this.txtProjectCode.Value;
                if (ProjectCode != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, ProjectCode));
                }
                sb.AddStrategy(new Strategy(BuildingStrategyName.IsArea, "2"));

                sb.AddOrder("BuildingName", true);

                string sql = sb.BuildMainQueryString();

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("Building", sql);
                qa.Dispose();

                //选择多个
                if (this.m_Multi == "1")
                {
                    DataRow dr = entity.CurrentTable.NewRow();
                    dr["BuildingCode"] = -1;
                    dr["BuildingName"] = "多选楼栋...";
                    entity.CurrentTable.Rows.InsertAt(dr, 0);
                }

                dgList.DataSource = entity;
                dgList.DataBind();
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }
Ejemplo n.º 4
0
        public static DataTable GetBuildingNoPBSUnit(string ProjectCode)
        {
            DataTable table2;

            try
            {
                BuildingStrategyBuilder builder = new BuildingStrategyBuilder();
                builder.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, ProjectCode));
                builder.AddStrategy(new Strategy(BuildingStrategyName.IsArea, "2"));
                builder.AddStrategy(new Strategy(BuildingStrategyName.NullPBSUnit));
                builder.AddOrder("BuildingName", true);
                QueryAgent agent       = new QueryAgent();
                string     queryString = builder.BuildMainQueryString();
                DataTable  table       = agent.ExecSqlForDataSet(queryString).Tables[0];
                agent.Dispose();
                table2 = table;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(table2);
        }
Ejemplo n.º 5
0
        private void LoadDataGrid(bool isEmpty)
        {
            try
            {
                BuildingStrategyBuilder sb = new BuildingStrategyBuilder("V_Building");

                if (isEmpty)
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.False));
                }

                string ProjectCode = this.txtProjectCode.Value;
                if (ProjectCode != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, ProjectCode));
                }

                if (this.txtSearchProjectCode.Value != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.InProjectCode, this.txtSearchProjectCode.Value));
                }

                if (this.sltSearchProjectStatus.Value != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectStatus, this.sltSearchProjectStatus.Value));
                }

                if (this.txtSearchBuildingName.Value != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.InBuildingName, this.txtSearchBuildingName.Value, "F"));
                }

                if (this.sltSearchPBSTypeCode.Value != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.PBSTypeCodeAllChild, this.sltSearchPBSTypeCode.Value));
                }

                if (this.txtSearchInvestType.Value != "")
                {
                    sb.AddStrategy(new Strategy(BuildingStrategyName.InInvestType, this.txtSearchInvestType.Value, "F"));
                }


                //排序
                string sortsql = BLL.GridSort.GetSortSQL(ViewState);
                if (sortsql == "")
                {
                    //缺省排序
                    if (ProjectCode == "")
                    {
                        sb.AddOrder("ProjectName", true);
                    }

                    sb.AddOrder("BuildingName", true);
                }

                string sql = sb.BuildMainQueryString();

                if (sortsql != "")
                {
                    //点列标题排序
                    sql = sql + " order by " + sortsql;
                }

                QueryAgent qa     = new QueryAgent();
                EntityData entity = qa.FillEntityData("V_Building", sql);
                qa.Dispose();

                string[]  arrField = { "HouseArea", "RoomArea", "TotalCost" };
                decimal[] arrSum   = BLL.MathRule.SumColumn(entity.CurrentTable, arrField);

                ViewState["SumCount"]     = entity.CurrentTable.Rows.Count.ToString() + "幢";
                ViewState["SumHouseArea"] = BLL.StringRule.BuildShowNumberString(arrSum[0]);
                ViewState["SumRoomArea"]  = BLL.StringRule.BuildShowNumberString(arrSum[1]);
                ViewState["SumTotalCost"] = BLL.StringRule.BuildShowNumberString(arrSum[2]);

                dgList.DataSource = entity;
                dgList.DataBind();

                if (this.GridPagination1.Visible)
                {
                    this.GridPagination1.RowsCount = entity.CurrentTable.Rows.Count.ToString();
                }

                entity.Dispose();

                //显示工具栏
                if (entity.HasRecord())
                {
                    this.trToolBar.Style["display"] = "";
                }
                else
                {
                    this.trToolBar.Style["display"] = "none";
                }
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "初始化页面出错:" + ex.Message));
            }
        }
Ejemplo n.º 6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                m_strGetType = Request.QueryString["GetType"] + "";                            //数据分类
                m_strLayer   = Request.QueryString["Layer"] + "";                              //需要取的层数
                m_strNodeId  = Request.QueryString["NodeId"] + "";                             //父节点编号
                string[] m_Layers           = (Request.QueryString["Layers"] + "").Split('.'); //定点展开的序列
                string   m_strSelectedLayer = Request.QueryString["SelectedLayer"] + "";       //定层展开的深度
                m_ProjectCode = Request.QueryString["ProjectCode"] + "";
                m_strShowSum  = Request.QueryString["ShowSum"] + "";                           //是否显示合计行

                DataTable m_Table = new DataTable("Building");
                m_Table.Columns.Add("BuildingCode");
                m_Table.Columns.Add("ParentCode");
                m_Table.Columns.Add("BuildingName");
                m_Table.Columns.Add("Layer");
                m_Table.Columns.Add("ChildNodesCount");
                m_Table.Columns.Add("ShowChildNodes");
                m_Table.Columns.Add("NodeType");
                m_Table.Columns.Add("IsArea");
                m_Table.Columns.Add("IconName");
                m_Table.Columns.Add("PBSTypeName");
                m_Table.Columns.Add("FloorCount");
                m_Table.Columns.Add("HouseArea");
                m_Table.Columns.Add("RoomArea");
                m_Table.Columns.Add("PBSUnitCode");
                m_Table.Columns.Add("PBSUnitName");
                m_Table.Columns.Add("PBSType");  //单位工程类型:P=项目;B=楼

                m_Table.Columns.Add("dHouseArea", typeof(decimal));
                m_Table.Columns.Add("dRoomArea", typeof(decimal));

                m_Table.Columns.Add("ShowSpan");
                m_Table.Columns.Add("ShowHref");

                //			EntityData m_Task=RmsPM.DAL.EntityDAO.ProductDAO.GetBuildingByProjectCode(ProjectCode);
                //			DataTable m_DataTable=m_Task.Tables["Building"];

                //查询条件
                BuildingStrategyBuilder sb = new BuildingStrategyBuilder();
                sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, m_ProjectCode));

                if (m_strGetType == "")
                {
                    #region 取第一层
                    //				DataView m_DV=new DataView(m_DataTable,"ParentCode=''","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.ParentCode, ""));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                    }

                    #endregion
                }
                else if (m_strGetType == "ChildNodes")
                {
                    #region 取某节点子目录
                    //				DataView m_DV=new DataView(m_DataTable,"ParentCode='"+m_strNodeId+"'","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.ParentCode, m_strNodeId));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                    }

                    if (m_strShowSum == "1")
                    {
                        AddSumRow(m_Table);
                    }

                    #endregion
                }
                else if (m_strGetType == "SelectLayer")
                {
                    #region 取制定层数结果
                    //				DataView m_DV=new DataView(m_DataTable,"Layer='1'","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.Layer, "1"));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                        if (int.Parse(m_strSelectedLayer) > 1)
                        {
                            m_NewRow["ShowChildNodes"] = "1";
                            this.FillSelectedLayerData(ref m_Table, m_Row["PBSTypeCode"].ToString(), 2, int.Parse(m_strSelectedLayer), m_DataTable);
                        }
                    }
                    #endregion
                }
                else if (m_strGetType == "All")
                {
                    #region 取所有结果
                    //				DataView m_DV=new DataView(m_DataTable,"Layer='1'","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.Layer, "1"));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);

                        if (int.Parse(m_NewRow["ChildNodesCount"].ToString()) > 0)
                        {
                            m_NewRow["ShowChildNodes"] = "1";
                            this.FillAllData(ref m_Table, m_Row["PBSTypeCode"].ToString(), 2, m_DataTable);
                        }
                    }
                    #endregion
                }
                else if (m_strGetType == "SingleNode")
                {
                    #region 单个节点
                    //				DataView m_DV=new DataView(m_DataTable,"BuildingCode='"+Request.QueryString["NodeId"]+""+"'","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.BuildingCode, m_strNodeId));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                    }
                    #endregion
                }
                else if (m_strGetType == "Project")
                {
                    #region 项目

                    EntityData entityProject = DAL.EntityDAO.ProjectDAO.GetProjectByCode(m_ProjectCode);
                    DataTable  m_DataTable   = entityProject.CurrentTable;
                    DataView   m_DV          = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRowProject(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                    }
                    entityProject.Dispose();

                    #endregion
                }
                else if (m_strGetType == "ChildNodesOfProject")
                {
                    #region 取某节点子目录
                    //				DataView m_DV=new DataView(m_DataTable,"ParentCode='"+m_strNodeId+"'","",DataViewRowState.CurrentRows);

                    sb.AddStrategy(new Strategy(BuildingStrategyName.ParentCode, ""));
                    sb.AddOrder("BuildingName", true);
                    DataTable m_DataTable = BuildStrategy(sb);
                    DataView  m_DV        = new DataView(m_DataTable);

                    foreach (DataRowView m_Row in m_DV)
                    {
                        DataRow m_NewRow = m_Table.NewRow();

                        this.FillRow(ref m_NewRow, m_Row);

                        m_Table.Rows.Add(m_NewRow);
                    }
                    #endregion
                }

                Response.Write(RmsPM.WebControls.TreeView.XmlTree.GetDataToXmlString(m_Table));
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }

            Response.End();
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string m_strGetType = Request.QueryString["GetType"] + "";                          //数据分类
            string m_strLayer   = Request.QueryString["Layer"] + "";                            //需要取的层数
            string m_strNodeId  = Request.QueryString["NodeId"] + "";                           //父节点编号

            string[] m_Layers           = (Request.QueryString["Layers"] + "").Split('.');      //定点展开的序列
            string   m_strSelectedLayer = Request.QueryString["SelectedLayer"] + "";            //定层展开的深度
            string   ProjectCode        = Request.QueryString["ProjectCode"] + "";
            string   PBSTypeCode        = Request.QueryString["PBSTypeCode"] + "";

            m_Table = new DataTable("Building");
            m_Table.Columns.Add("BuildingCode");
            m_Table.Columns.Add("ParentCode");
            m_Table.Columns.Add("BuildingName");
            m_Table.Columns.Add("Description");
            m_Table.Columns.Add("Layer");
            m_Table.Columns.Add("ChildNodesCount");
            m_Table.Columns.Add("ShowChildNodes");
            m_Table.Columns.Add("NodeType");
            m_Table.Columns.Add("IsArea");
            m_Table.Columns.Add("NoSelectArea");
            m_Table.Columns.Add("PBSUnitName");
            m_Table.Columns.Add("IconName");

//			EntityData entity = DAL.EntityDAO.ProductDAO.GetBuildingByProjectCode(ProjectCode);
//			m_DataTable=entity.CurrentTable;

            //查询条件
            BuildingStrategyBuilder sb = new BuildingStrategyBuilder("V_Building");

            sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, ProjectCode));

            if (PBSTypeCode != "")
            {
                sb.AddStrategy(new Strategy(BuildingStrategyName.PBSTypeCodeAllChild, PBSTypeCode));
            }

            if (m_strGetType == "")
            {
                #region 取第一层
//				DataRow m_NewRow=m_Table.NewRow();
//				this.FillRootRow(ref m_NewRow);
//				m_Table.Rows.Add(m_NewRow);

                //缺省打开根节点
//				DataView m_DV=new DataView(m_DataTable,"isnull(ParentCode,'')=''","",DataViewRowState.CurrentRows);

                sb.AddStrategy(new Strategy(BuildingStrategyName.ParentCode, ""));
                sb.AddOrder("BuildingName", true);
                DataTable m_DataTable = BuildStrategy(sb);
                DataView  m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                }

                #endregion
            }
            else if (m_strGetType == "ChildNodes")
            {
                #region 取某节点子目录
//				DataView m_DV=new DataView(m_DataTable,"isnull(ParentCode,'')='"+m_strNodeId+"'","",DataViewRowState.CurrentRows);

                sb.AddStrategy(new Strategy(BuildingStrategyName.ParentCode, m_strNodeId));
                sb.AddOrder("BuildingName", true);
                DataTable m_DataTable = BuildStrategy(sb);
                DataView  m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                }
                #endregion
            }
            else if (m_strGetType == "SelectLayer")
            {
                #region 取制定层数结果
//				DataView m_DV=new DataView(m_DataTable,"Deep='1'","",DataViewRowState.CurrentRows);

                sb.AddStrategy(new Strategy(BuildingStrategyName.Layer, "1"));
                sb.AddOrder("BuildingName", true);
                DataTable m_DataTable = BuildStrategy(sb);
                DataView  m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                    if (int.Parse(m_strSelectedLayer) > 1)
                    {
                        m_NewRow["ShowChildNodes"] = "1";
                        this.FillSelectedLayerData(m_Row["BuildingCode"].ToString(), 2, int.Parse(m_strSelectedLayer));
                    }
                }
                #endregion
            }
            else if (m_strGetType == "All")
            {
                #region 取所有结果
//				DataView m_DV=new DataView(m_DataTable,"isnull(ParentCode,'')=''","",DataViewRowState.CurrentRows);

                sb.AddStrategy(new Strategy(BuildingStrategyName.Layer, "1"));
                sb.AddOrder("BuildingName", true);
                DataTable m_DataTable = BuildStrategy(sb);
                DataView  m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);

                    if (int.Parse(m_NewRow["ChildNodesCount"].ToString()) > 0)
                    {
                        m_NewRow["ShowChildNodes"] = "1";
                        this.FillAllData(m_Row["BuildingCode"].ToString(), 2);
                    }
                }
                #endregion
            }
            else if (m_strGetType == "SingleNode")
            {
                #region 单个节点
//				DataView m_DV=new DataView(m_DataTable,"BuildingCode='"+Request.QueryString["NodeId"]+""+"'","",DataViewRowState.CurrentRows);

                sb.AddStrategy(new Strategy(BuildingStrategyName.BuildingCode, m_strNodeId));
                sb.AddOrder("BuildingName", true);
                DataTable m_DataTable = BuildStrategy(sb);
                DataView  m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                }
                #endregion
            }

            Response.Write(RmsPM.WebControls.TreeView.XmlTree.GetDataToXmlString(m_Table));
            Response.End();
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string m_strGetType = Request.QueryString["GetType"] + "";                          //数据分类
            string m_strLayer   = Request.QueryString["Layer"] + "";                            //需要取的层数
            string m_strNodeId  = Request.QueryString["NodeId"] + "";                           //父节点编号

            string[] m_Layers           = (Request.QueryString["Layers"] + "").Split('.');      //定点展开的序列
            string   m_strSelectedLayer = Request.QueryString["SelectedLayer"] + "";            //定层展开的深度
            string   ProjectCode        = Request.QueryString["ProjectCode"] + "";
            string   PBSTypeCode        = Request.QueryString["PBSTypeCode"] + "";

            m_Table = new DataTable("Building");
            m_Table.Columns.Add("BuildingCode");
            m_Table.Columns.Add("ParentCode");
            m_Table.Columns.Add("BuildingName");
            m_Table.Columns.Add("Description");
            m_Table.Columns.Add("Layer");
            m_Table.Columns.Add("ChildNodesCount");
            m_Table.Columns.Add("ShowChildNodes");
            m_Table.Columns.Add("NodeType");
            m_Table.Columns.Add("IsPBSUnit");
            m_Table.Columns.Add("NoSelectPBSUnit");
            m_Table.Columns.Add("IconName");
            m_Table.Columns.Add("PBSUnitName");

            //查询条件
            BuildingStrategyBuilder sb = new BuildingStrategyBuilder("V_Building");

            sb.AddStrategy(new Strategy(BuildingStrategyName.ProjectCode, ProjectCode));

            if (PBSTypeCode != "")
            {
                sb.AddStrategy(new Strategy(BuildingStrategyName.PBSTypeCodeAllChild, PBSTypeCode));
            }

            EntityData entityU;

            DataTable m_DataTable;
            DataView  m_DV;

            switch (m_strGetType.ToLower())
            {
            case "pbsunit":
                #region 取第一层 单位工程,下分楼栋

                entityU = DAL.EntityDAO.PBSDAO.GetPBSUnitByProject(ProjectCode);
                entityU.Dispose();
                m_DataTable = entityU.CurrentTable;
                m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRowPBSUnit(ref m_NewRow, m_Row, true);

                    m_Table.Rows.Add(m_NewRow);
                }

                break;
                #endregion

            case "onlypbsunit":
                #region 取单位工程

                entityU = DAL.EntityDAO.PBSDAO.GetPBSUnitByProject(ProjectCode);
                entityU.Dispose();
                m_DataTable = entityU.CurrentTable;
                m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRowPBSUnit(ref m_NewRow, m_Row, false);

                    m_Table.Rows.Add(m_NewRow);
                }

                break;
                #endregion

            case "buildingofpbsunit":
                #region 取某单位工程下的楼栋

                sb.AddStrategy(new Strategy(BuildingStrategyName.PBSUnitCode, m_strNodeId));
                sb.AddOrder("BuildingName", true);
                m_DataTable = BuildStrategy(sb);
                m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                }

                break;
                #endregion

            case "building":
                #region 取所有楼栋

                sb.AddStrategy(new Strategy(BuildingStrategyName.IsArea, "2"));
                sb.AddOrder("BuildingName", true);
                m_DataTable = BuildStrategy(sb);
                m_DV        = new DataView(m_DataTable);

                foreach (DataRowView m_Row in m_DV)
                {
                    DataRow m_NewRow = m_Table.NewRow();

                    this.FillRow(ref m_NewRow, m_Row);

                    m_Table.Rows.Add(m_NewRow);
                }

                break;
                #endregion

            default:
                break;
            }

            Response.Write(RmsPM.WebControls.TreeView.XmlTree.GetDataToXmlString(m_Table));
            Response.End();
        }