Пример #1
0
        //public List<VerticalCurv> GetVerticalCurve()
        //{
        //    if (DbConnection == null) return null;
        //    List<VerticalCurv> list = new List<VerticalCurv>();
        //    string sql = @"select VerticalCurveID from RDC_VerticalCurve";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    //sql = @"insert into RDC_VerticalCurve(RouteID,VerticalCurveType,GradeChangePointNumber,CurveNumber,VerticalCurveLength,BeginStake,EndStake,Description) values('" + RouteID + "','" + vc.VerticalCurveType + "','" + vc.GradeChangePointNumber + "','" + vc.CurveNumber + "','" + vc.VerticalCurveLength + "','" + vc.BeginStake + "','" + vc.EndStake + "','" + vc.Description + "')";
        //    //DbConnection.ExecCommand(sql);
        //    foreach (DataRow r in ds.Tables[0].Rows)
        //    {
        //        VerticalCurv vc = new VerticalCurv(DbConnection);
        //        int id = int.Parse(r[0].ToString());
        //        vc.Load(id);
        //        list.Add(vc);
        //    }
        //    return list;
        //}
        ///// <summary>
        ///// 获取平曲线
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public List<FlatCurver> GetFlatCurve()
        //{
        //    List<FlatCurver> list = new List<FlatCurver>();
        //    FlatCurver fc = new FlatCurver(DbConnection);
        //    string sql = @"select FlatCurveID from RDC_FlatCurve";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    foreach (DataRow r in ds.Tables[0].Rows)
        //    {
        //        //sql = @"insert into RDC_FlatCurve(RouteID,FlatCurveType,IntersectionPointNumber,CurveNumber,FlatCurveLength,BeginStake,EndStake,Description) values('" + RouteID + "','" + fc.FlatCurveType + "','" + fc.IntersectionPointNumber + "','" + fc.CurveNumber + "','" + fc.FlatCurveLength + "','" + fc.BeginStake + "','" + fc.EndStake + "','" + fc.Description + "')";
        //        //DbConnection.GetDataSet(sql);
        //        FlatCurver f = new FlatCurver(DbConnection);
        //        int id = int.Parse(r[0].ToString());
        //        f.Load(id);
        //        list.Add(f);
        //    }
        //    return list;
        //}
        ///// <summary>
        ///// 获取路幅宽度变化
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public RoadWidthChange GetRoadWidthChange()
        //{
        //    RoadWidthChange rwc = new RoadWidthChange(DbConnection);
        //    string sql = @"select RoadWidthChangeID from RDC_RoadWidthChange where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_RoadWidthChange(RouteID,SerialNumber,Stake,LeftSoilShoulder,LeftHardShoulder,LeftCarriageway,LeftMiddle,RightMiddle,RightCarriageway,RightHardShoulder,RightSoilShoulder,Remarks)
        //               values('" + RouteID + "','" + rwc.SerialNumber + "','" + rwc.Stake + "','" + rwc.LeftSoilShoulder + "','" + rwc.LeftHardShoulder + "','" + rwc.LeftCarriageway + "','" + rwc.LeftMiddle + "','" + rwc.RightMiddle + "','" + rwc.RightCarriageway + "','" + rwc.RightHardShoulder + "','" + rwc.RightSoilShoulder + "','" + rwc.Remarks + "')";
        //        DbConnection.ExecCommand(sql);
        //    }
        //    rwc.Load();
        //    return rwc;
        //}
        ///// <summary>
        ///// 获取横坡变化表
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public CrossSlopeChange GetCrossSlopeChange()
        //{
        //    CrossSlopeChange csc = new CrossSlopeChange(DbConnection);
        //    string sql = @"select CrossSlopeChangeID from RDC_CrossSlopeChange where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_CrossSlopeChange(RouteID,SerialNumber,Stake,LeftSoilShoulder,LeftHardShoulder,LeftCarriageway,LeftMiddle,RightMiddle,RightCarriageway,RightHardShoulder,RightSoilShoulder,Remarks)
        //               values('" + RouteID + "','" + csc.SerialNumber + "','" + csc.Stake + "','" + csc.LeftSoilShoulder + "','" + csc.LeftHardShoulder + "','" + csc.LeftCarriageway + "','" + csc.LeftMiddle + "','" + csc.RightMiddle + "','" + csc.RightCarriageway + "','" + csc.RightHardShoulder + "','" + csc.RightSoilShoulder + "','" + csc.Remarks + "')";
        //        ds = DbConnection.GetDataSet(sql);
        //    }
        //    csc.Load();
        //    return csc;
        //}
        ///// <summary>
        ///// 获取横断面地面线
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public CrossSectionGroundLine GetCrossSectionGroundLine()
        //{
        //    CrossSectionGroundLine csgl = new CrossSectionGroundLine(DbConnection);
        //    string sql = @"select CrossSectionGroundLineID from RDC_CrossSectionGroundLine where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_CrossSectionGroundLine(RouteID,Stake) values('" + RouteID + "','" + csgl.Stake + "')";
        //        ds = DbConnection.GetDataSet(sql);
        //    }
        //    csgl.Load();
        //    return csgl;
        //}
        ///// <summary>
        ///// 获取桥梁
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public List<Bridge> GetBridgeList()
        //{
        //    List<Bridge> list = new List<Bridge>();
        //    string sql = @"select BridgeID from RDC_Bridge where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    //if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    //{
        //    //    sql = @"insert into RDC_Bridge(RouteID,Stake,StartStake,EndStake,Type,Name,Angle,LeftWidth,RightWidth,SpanDescription) values('" + r.RouteID + "','" + r.Stake + "','" + r.StartStake + "','" + r.EndStake + "','" + r.Type + "','" + r.Name + "','" + r.Angle + "','" + r.LeftWidth + "','" + r.RightWidth + "','" + r.SpanDescription + "')";
        //    //    ds = DbConnection.GetDataSet(sql);
        //    //}
        //    foreach (DataRow r in ds.Tables[0].Rows)
        //    {
        //        Bridge cs = new Bridge(DbConnection);
        //        //cs.DbConnection = DbConnection;
        //        int id = int.Parse(r[0].ToString());
        //        cs.Load(id);
        //        list.Add(cs);
        //    }
        //    return list;
        //}
        ///// <summary>
        ///// 获取断链
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public List<BrokenChanage> GetBrokenChanageList()
        //{
        //    List<BrokenChanage> list = new List<BrokenChanage>();
        //    string sql = @"select BrokenID from RDC_BrokenChainage";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    foreach (DataRow r in ds.Tables[0].Rows)
        //    {
        //        BrokenChanage cs = new BrokenChanage(DbConnection);
        //        int id = int.Parse(r[0].ToString());
        //        cs.Load(id);
        //        list.Add(cs);
        //    }
        //    return list;
        //}
        ///// <summary>
        ///// 获取纵断面地面线
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public VerticalSectionGroundLine GetVerticalSectionGroundLine()
        //{
        //    VerticalSectionGroundLine vsgl = new VerticalSectionGroundLine(DbConnection);
        //    string sql = @"select ID from RDC_VerticalSectionGroundLine where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_VerticalSectionGroundLine(RouteID,SerialNumber,Stake,H) values('" + RouteID + "','" + vsgl.SerialNumber + "','" + vsgl.Stake + "','" + vsgl.H + "')";
        //        ds = DbConnection.GetDataSet(sql);
        //    }
        //    vsgl.Load();
        //    return vsgl;
        //}
        ///// <summary>
        ///// 获取平面交叉口
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public List<PlaneIntersection> GetPlaneIntersectionList()
        //{
        //    List<PlaneIntersection> list = new List<PlaneIntersection>();
        //    PlaneIntersection pi = new PlaneIntersection(DbConnection);
        //    string sql = @"select PlaneIntersectionID from RDC_PlaneIntersection where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_PlaneIntersection(RouteID,Stake,PlaneInterName,bCalcLeft,LeftBt,LeftL,LeftR1,LeftR2,LeftR3,LeftR4,LeftW1,LeftW2,LeftW3,LeftW4,bCalcRight,RightBt,RightR1,RightR2,RightR3,RightR4,RightW1,RightW2,RightW3,RightW4,Remarks)
        //               values('" + RouteID + "','" + pi.Stake + "','" + pi.PlaneInterName + "','" + pi.bCalcLeft + "','" + pi.LeftBt + "','" + pi.LeftL + "','" + pi.LeftR1 + "','" + pi.LeftR2 + "','" + pi.LeftR3 + "','" + pi.LeftR4 + "','" + pi.LeftW1 + "','" + pi.LeftW2 + "','" + pi.LeftW3 + "','" + pi.LeftW4 + "','" + pi.bCalcRight + "','" + pi.RightBt + "','" + pi.RightL + "','" + pi.RightR1 + "','" + pi.RightR2 + "','" + pi.RightR3 + "','" + pi.RightR4 + "','" + pi.RightW1 + "',,'" + pi.RightW2 + "','" + pi.RightW3 + "','" + pi.RightW4 + "','" + pi.Remarks + "')";
        //         DbConnection.ExecCommand(sql);
        //    }
        //   list= pi.Load();
        //    return list;
        //}
        ///// <summary>
        ///// 获取涵洞
        ///// </summary>
        ///// <param name="ct"></param>
        ///// <returns></returns>
        //public List<Culvert> GetCulvertList()
        //{
        //    List<Culvert> list = new List<Culvert>();
        //    Culvert ct = new Culvert(DbConnection);
        //    string sql = @"select CulvertID from RDC_Culvert";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    foreach (DataRow r in ds.Tables[0].Rows)
        //    {
        //        //sql = @"insert into RDC_Culvert(RouteID,CenterStake,CulvertName,StructureFrom,Angle,BottomH,SpanDescription) values('" + RouteID + "','" + ct.CenterStake + "','" + ct.CulvertName + "','" + ct.StructureFrom + "','" + ct.Angle + "','" + ct.BottomH + "','" + ct.SpanDescription + "')";
        //        //ds = DbConnection.GetDataSet(sql);
        //        Culvert c = new Culvert(DbConnection);
        //        //c.DbConnection = DbConnection;
        //        int id = int.Parse(r[0].ToString());
        //        c.Load(id);
        //        list.Add(c);
        //    }
        //    return list;
        //}
        ///// <summary>
        ///// 获取设计横断面地面线
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public CrossSectionDesignLine GetCrossSectionDesignLine()
        //{
        //    CrossSectionDesignLine csdl = new CrossSectionDesignLine(DbConnection);
        //    //csdl.DbConnection = DbConnection;
        //    string sql = @"select CrossSectionDesignLineID from RDC_CrossSectionDesignLine where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_CrossSectionDesignLine(RouteID,Stake) values('" + RouteID + "','" + csdl.Stake + "')";
        //        DbConnection.ExecCommand(sql);
        //    }
        //    csdl.Load();
        //    return csdl;
        //}
        ///// <summary>
        ///// 获取加桩
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        //public AdditionalStake GetAddStake()
        //{
        //    AdditionalStake adds = new AdditionalStake(DbConnection);
        //    string sql = @"select AddStakeID from RDC_AdditionalStake where RouteID='" + RouteID + "'";
        //    DataSet ds = DbConnection.GetDataSet(sql);
        //    if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
        //    {
        //        sql = @"insert into RDC_AdditionalStake(RouteID,Stake,Description) values('" + RouteID + "','" + adds.Stake + "','" + adds.Description + "')";
        //        ds = DbConnection.GetDataSet(sql);
        //    }
        //    adds.Load(RouteID);
        //    return adds;
        //}
        ///// <summary>
        ///// 获取隧道
        ///// </summary>
        ///// <param name="r"></param>
        ///// <returns></returns>
        public List<Tunnel> GetTunnelList()
        {
            List<Tunnel> list = new List<Tunnel>();

            string sql = @"select TunnelID from RDC_Tunnel where RouteID='" + RouteID + "'";
            DataSet ds = DbConnection.GetDataSet(sql);
            //if (ds != null && ds.Tables[0].Rows.Count == 0)//表中的行数为0就插入一条数据
            //{
            //    sql = @"insert into RDC_Tunnel(RouteID,Stake,StartStake,EndStake,Type,Name,Angle,LeftWidth,RightWidth,SpanDescription) values('" + RouteID + "','" + t.Stake + "','" + t.StartStake + "','" + t.EndStake + "','" + t.Type + "','" + t.Name + "','" + t.Angle + "','" + t.LeftWidth + "','" + t.RightWidth + "','" + t.SpanDescription + "')";
            //    ds = DbConnection.GetDataSet(sql);
            //}
            System.Text.StringBuilder strSql = new System.Text.StringBuilder();
            strSql.Append("@a");

            SqlParameter[] parameter = {
                    new SqlParameter("@a",DbType.Int16),
            };
            --
            parameter[0].Value =

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                Tunnel cs = new Tunnel(DbConnection);
                //cs.DbConnection = DbConnection;
                int id = int.Parse(r[0].ToString());
                cs.Load(id);
                list.Add(cs);
            }
            return list;
        }
Пример #2
0
 /// <summary>
 /// 加载加桩
 /// </summary>
 /// <param name="RouteID"></param>
 /// <returns></returns>
 public List<Tunnel> Load(int RouteID)
 {
     if (DbConnection == null) return null;
     List<Tunnel> list = new List<Tunnel>();
     string sql = @"select *from RDC_Tunnel where RouteID='" + RouteID + "'";
      DataSet ds= DbConnection.GetDataSet(sql);
     foreach (DataRow r in ds.Tables[0].Rows)
     {
         Tunnel t = new Tunnel();
         t.TunnelID= r["TunnelID"] == DBNull.Value ? 0 : Convert.ToInt32(r["TunnelID"]);
         t.RouteID = r["RouteID"] == DBNull.Value ? 0 : Convert.ToInt32(r["RouteID"]);
         t.Stake = r["Stake"].ToString();
         t.StartStake = r["StartStake"].ToString();
         t.EndStake = r["EndStake"].ToString();
         t.Type= r["Type"] == DBNull.Value ? 0 : Convert.ToInt32(r["Type"]);
         t.Name = r["Name"].ToString();
         t.Angle = r["Angle"] == DBNull.Value ? 0 : Convert.ToDouble(r["Angle"]);
         t.LeftWidth = r["LeftWidth"] == DBNull.Value ? 0 : Convert.ToDouble(r["LeftWidth"]);
         t.RightWidth = r["RightWidth"] == DBNull.Value ? 0 : Convert.ToDouble(r["RightWidth"]);
         t.SpanDescription = r["SpanDescription"].ToString();
         list.Add(t);
     }
     return list;
 }
Пример #3
0
 /// <summary>                                                          
 /// 隧道Csv文件查询结果转换成泛型集合                                         
 /// </summary>                                                                            
 /// <param name="filePath">文件路径</param>                         
 /// <returns>以实体类为元素的泛型集合</returns>
 public List<Tunnel> ImportTunnelList(string filePath)
 {
     List<Tunnel> tunel = new List<Tunnel>();
     StreamReader fileReader = new StreamReader(filePath, Encoding.Default);
     try
     {
         //列之间的分隔符
         char cv = ',';
         while (fileReader.EndOfStream == false)
         {
             Tunnel t = new Tunnel();
             string line = fileReader.ReadLine();
             string[] y = line.Split(cv);
             t.Stake = y[0].Trim().ToString();
             t.StartStake =y[1].Trim().ToString();
             t.EndStake =y[2].Trim().ToString();
             t.Type = Convert.ToInt32(y[3].Trim().ToString());
             t.Name =y[4].Trim().ToString();
             t.Angle = Convert.ToDouble(y[5].Trim().ToString());
             t.LeftWidth = Convert.ToDouble(y[6].Trim().ToString());
             t.RightWidth = Convert.ToDouble(y[7].Trim().ToString());
             t.SpanDescription = y[8].Trim().ToString();
             tunel.Add(t);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         fileReader.Close();
         fileReader.Dispose();
     }
     return tunel;
 }