예제 #1
0
        static string GetJson(桩柱钻孔工程集 input)
        {
            JavaScriptSerializer JSSerializer = new JavaScriptSerializer();
            string JsonStr = JSSerializer.Serialize(input);

            return(JsonStr);
        }
예제 #2
0
        static 桩柱钻孔工程集 BuildDataTree()
        {
            钻孔集 i钻孔集 = new 钻孔集 {
            };

            foreach (DataRow i基本 in CagdData.Tables["基本数据表"].Rows)
            {
                string i钻孔编号 = toStr(i基本["钻孔编号"]);
                钻孔     i钻孔   = new 钻孔();
                i钻孔.孔口标高   = toNum(i基本["孔口标高"]);
                i钻孔.钻孔深度   = toNum(i基本["钻孔深度"]);
                i钻孔.线别工程名称 = toStr(i基本["线别工程名称"]);
                foreach (DataRow i分层 in CagdData.Tables["分层数据表"].Select("钻孔编号 = \'" + i钻孔编号 + "\'"))
                {
                    地层 i地层 = new 地层();
                    i地层.地层序号 = toStr(i分层["地层序号"]);
                    i地层.地层编号 = toStr(i分层["地层编号"]);
                    i地层.土类代码 = toStr(i分层["土类代码"]);
                    i地层.土类名称 = toStr(i分层["土类名称"]);
                    i地层.换层深度 = toNum(i分层["换层深度"]);
                    i地层.年代成因 = toStr(i分层["年代成因"]);
                    i地层.野外描述 = toStr(i分层["野外描述"]);
                    if (GlobalInfo.地层力学特性.ContainsKey(i地层.地层编号))
                    {
                        i地层.侧摩阻力标准值 = GlobalInfo.地层力学特性[i地层.地层编号][0];
                        i地层.容许承载力   = GlobalInfo.地层力学特性[i地层.地层编号][1];
                    }
                    i钻孔.地层集.Add(i地层);
                }
                i钻孔.地层集 = i钻孔.地层集.OrderBy(x => long.Parse(x.地层序号)).ToList();
                i钻孔集.Add(i钻孔编号, i钻孔);
            }
            桩柱钻孔工程集 i桩柱钻孔工程集 = new 桩柱钻孔工程集();

            i桩柱钻孔工程集.钻孔集 = i钻孔集;
            return(i桩柱钻孔工程集);
        }