Ejemplo n.º 1
0
        /// <summary>
        /// 新增RBC信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(RBCInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into RBCInfo(GroupID,Category,StartStationName,EndStationName,AreaID,RBCID,PhoneNum,StartPoint,Cutoff,EndPoint) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartStationName", dao.StartStationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndStationName", dao.EndStationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("AreaID", dao.AreaID, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("RBCID", dao.RBCID, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("PhoneNum", dao.PhoneNum, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartPoint", dao.StartPoint, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Cutoff", dao.Cutoff, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndPoint", dao.EndPoint, SqlDbType.NVarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新坐标系信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(CoordinateInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update CoordinateInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",CoordinateID=");
            stmt.AppendParameter(_session.MakeInParameter("CoordinateID", dao.CoordinateID, SqlDbType.VarChar));
            stmt.AppendString(",CoordinateName=");
            stmt.AppendParameter(_session.MakeInParameter("CoordinateName", dao.CoordinateName, SqlDbType.VarChar));
            stmt.AppendString(",Length=");
            stmt.AppendParameter(_session.MakeInParameter("Length", dao.Length, SqlDbType.VarChar));
            stmt.AppendString(",Remark=");
            stmt.AppendParameter(_session.MakeInParameter("Remark", dao.Remark, SqlDbType.VarChar));
            stmt.AppendString(",IsReversed=");
            stmt.AppendParameter(_session.MakeInParameter("IsReversed", dao.IsReversed, SqlDbType.VarChar));
            stmt.AppendString(",CurrentMileage=");
            stmt.AppendParameter(_session.MakeInParameter("CurrentMileage", dao.CurrentMileage, SqlDbType.VarChar));
            stmt.AppendString(",EdgeMileage=");
            stmt.AppendParameter(_session.MakeInParameter("EdgeMileage", dao.EdgeMileage, SqlDbType.VarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新应答器位置
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(TransponderLocation dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update TransponderLocation set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",TransponderName=");
            stmt.AppendParameter(_session.MakeInParameter("TransponderName", dao.TransponderName, SqlDbType.NVarChar));
            stmt.AppendString(",TransponderID=");
            stmt.AppendParameter(_session.MakeInParameter("TransponderID", dao.TransponderID, SqlDbType.NVarChar));
            stmt.AppendString(",Mileage=");
            stmt.AppendParameter(_session.MakeInParameter("Mileage", dao.Mileage, SqlDbType.NVarChar));
            stmt.AppendString(",Type=");
            stmt.AppendParameter(_session.MakeInParameter("Type", dao.Type, SqlDbType.NVarChar));
            stmt.AppendString(",Usage=");
            stmt.AppendParameter(_session.MakeInParameter("Usage", dao.Usage, SqlDbType.NVarChar));
            stmt.AppendString(",Remark1=");
            stmt.AppendParameter(_session.MakeInParameter("Remark1", dao.Remark1, SqlDbType.NVarChar));
            stmt.AppendString(",Remark2=");
            stmt.AppendParameter(_session.MakeInParameter("Remark2", dao.Remark2, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 新增车站信息
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(StationInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into StationInfo(GroupID,StationName,RegionID,AreaID,StationID) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("RegionID", dao.RegionID, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("AreaID", dao.AreaID, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StationID", dao.StationID, SqlDbType.Int));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 更新断链信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(ChainScissionInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update ChainScissionInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",LineName=");
            stmt.AppendParameter(_session.MakeInParameter("LineName", dao.LineName, SqlDbType.NVarChar));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",Type=");
            stmt.AppendParameter(_session.MakeInParameter("Type", dao.Type, SqlDbType.NVarChar));
            stmt.AppendString(",StartMileage=");
            stmt.AppendParameter(_session.MakeInParameter("StartMileage", dao.StartMileage, SqlDbType.NVarChar));
            stmt.AppendString(",EndMileage=");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",LongChain=");
            stmt.AppendParameter(_session.MakeInParameter("LongChain", dao.LongChain, SqlDbType.Int));
            stmt.AppendString(",ShortChain=");
            stmt.AppendParameter(_session.MakeInParameter("ShortChain", dao.ShortChain, SqlDbType.Int));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新线路坡度表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(GradientInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update GradientInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",StartStationName=");
            stmt.AppendParameter(_session.MakeInParameter("StartStationName", dao.StartStationName, SqlDbType.NVarChar));
            stmt.AppendString(",EndStationName=");
            stmt.AppendParameter(_session.MakeInParameter("EndStationName", dao.EndStationName, SqlDbType.NVarChar));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",Gradient=");
            stmt.AppendParameter(_session.MakeInParameter("Gradient", dao.Gradient, SqlDbType.Decimal));
            stmt.AppendString(",Length=");
            stmt.AppendParameter(_session.MakeInParameter("Length", dao.Length, SqlDbType.Int));
            stmt.AppendString(",EndMileage=");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",Remark=");
            stmt.AppendParameter(_session.MakeInParameter("Remark", dao.Remark, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 新增应答器位置
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(TransponderLocation dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into TransponderLocation(GroupID,Category,TransponderName,TransponderID,Mileage,Type,Usage,Remark1,Remark2) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("TransponderName", dao.TransponderName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("TransponderID", dao.TransponderID, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Mileage", dao.Mileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Type", dao.Type, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Usage", dao.Usage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark1", dao.Remark1, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark2", dao.Remark2, SqlDbType.NVarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 新增坐标系信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(CoordinateInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into CoordinateInfo(GroupID,Category,CoordinateID,CoordinateName,Length,Remark,IsReversed,CurrentMileage,EdgeMileage) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("CoordinateID", dao.CoordinateID, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("CoordinateName", dao.CoordinateName, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Length", dao.Length, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark", dao.Remark, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("IsReversed", dao.IsReversed, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("CurrentMileage", dao.CurrentMileage, SqlDbType.VarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EdgeMileage", dao.EdgeMileage, SqlDbType.VarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 更新灾害信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(DisasterInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update DisasterInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",StartMileage=");
            stmt.AppendParameter(_session.MakeInParameter("StartMileage", dao.StartMileage, SqlDbType.NVarChar));
            stmt.AppendString(",EndMileage=");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",WarningRelay=");
            stmt.AppendParameter(_session.MakeInParameter("WarningRelay", dao.WarningRelay, SqlDbType.NVarChar));
            stmt.AppendString(",AffectedSectionName=");
            stmt.AppendParameter(_session.MakeInParameter("AffectedSectionName", dao.AffectedSectionName, SqlDbType.NVarChar));
            stmt.AppendString(",Remark=");
            stmt.AppendParameter(_session.MakeInParameter("Remark", dao.Remark, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 删除指定主键的站内轨道区段与道岔映射表
        /// </summary>
        /// <param name="sectionName">区段名称</param>
        /// <param name="stationName">车站名称</param>
        /// <returns>成功/失败</returns>
        public bool Delete(string sectionName, string stationName)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("delete from StationSectionMapping where ");
            stmt.AppendString("SectionName=");
            stmt.AppendParameter(_session.MakeInParameter("SectionName", sectionName, SqlDbType.NVarChar));
            stmt.AppendString(" and StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", stationName, SqlDbType.NVarChar));
            stmt.StatementType = SqlStatementType.Delete;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 删除指定主键的道岔信息表
        /// </summary>
        /// <param name="stationName">车站名称</param>
        /// <param name="turnoutName">道岔名称</param>
        /// <returns>成功/失败</returns>
        public bool Delete(string stationName, int turnoutName)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("delete from TurnoutInfo where ");
            stmt.AppendString("StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", stationName, SqlDbType.NVarChar));
            stmt.AppendString(" and TurnoutName=");
            stmt.AppendParameter(_session.MakeInParameter("TurnoutName", turnoutName, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Delete;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 更新分相信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(PhaseSplittingInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update PhaseSplittingInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",Category=");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",StartMileage=");
            stmt.AppendParameter(_session.MakeInParameter("StartMileage", dao.StartMileage, SqlDbType.NVarChar));
            stmt.AppendString(",EndMileage=");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",Length=");
            stmt.AppendParameter(_session.MakeInParameter("Length", dao.Length, SqlDbType.Int));
            stmt.AppendString(",Remark1=");
            stmt.AppendParameter(_session.MakeInParameter("Remark1", dao.Remark1, SqlDbType.NVarChar));
            stmt.AppendString(",Remark2=");
            stmt.AppendParameter(_session.MakeInParameter("Remark2", dao.Remark2, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 新增线路坡度表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(GradientInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into GradientInfo(GroupID,StartStationName,EndStationName,Category,Gradient,Length,EndMileage,Remark) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartStationName", dao.StartStationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndStationName", dao.EndStationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Gradient", dao.Gradient, SqlDbType.Decimal));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Length", dao.Length, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark", dao.Remark, SqlDbType.NVarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 更新站内区段信息
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(StationSectionInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update StationSectionInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.AppendString(",SectionName=");
            stmt.AppendParameter(_session.MakeInParameter("SectionName", dao.SectionName, SqlDbType.NVarChar));
            stmt.AppendString(",SectionCarrirer=");
            stmt.AppendParameter(_session.MakeInParameter("SectionCarrirer", dao.SectionCarrirer, SqlDbType.NVarChar));
            stmt.AppendString(",SectionLength=");
            stmt.AppendParameter(_session.MakeInParameter("SectionLength", dao.SectionLength, SqlDbType.Int));
            stmt.AppendString(",LayerType=");
            stmt.AppendParameter(_session.MakeInParameter("LayerType", dao.LayerType, SqlDbType.Int));
            stmt.AppendString(",TurnoutIDs=");
            stmt.AppendParameter(_session.MakeInParameter("TurnoutIDs", dao.TurnoutIDs, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 新增断链信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(ChainScissionInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into ChainScissionInfo(GroupID,LineName,Category,Type,StartMileage,EndMileage,LongChain,ShortChain) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LineName", dao.LineName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Type", dao.Type, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartMileage", dao.StartMileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LongChain", dao.LongChain, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("ShortChain", dao.ShortChain, SqlDbType.Int));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 新增站内区段信息
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(StationSectionInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into StationSectionInfo(GroupID,StationName,SectionName,SectionCarrirer,SectionLength,LayerType,TurnoutIDs) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("SectionName", dao.SectionName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("SectionCarrirer", dao.SectionCarrirer, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("SectionLength", dao.SectionLength, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LayerType", dao.LayerType, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("TurnoutIDs", dao.TurnoutIDs, SqlDbType.NVarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 新增桥梁隧道信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(BridgeAndTunnelInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into BridgeAndTunnelInfo(GroupID,Category,StartMileage,EndMileage,Type,Remark1,Remark2) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Category", dao.Category, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartMileage", dao.StartMileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("EndMileage", dao.EndMileage, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Type", dao.Type, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark1", dao.Remark1, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Remark2", dao.Remark2, SqlDbType.NVarChar));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 删除指定主键的坐标系信息表
        /// </summary>
        /// <param name="iD">顺序号</param>
        /// <returns>成功/失败</returns>
        public bool Delete(int iD)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("delete from CoordinateInfo where ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", iD, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Delete;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 新增批次信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(GroupInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into GroupInfo(GroupID,GroupName,StartTime,OperatorName,IsSuccessed) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("GroupName", dao.GroupName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("StartTime", dao.StartTime, SqlDbType.DateTime));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("OperatorName", dao.OperatorName, SqlDbType.NVarChar));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("IsSuccessed", dao.IsSuccessed, SqlDbType.Bit));
            stmt.AppendString(")");
            stmt.StatementType = SqlStatementType.Insert;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 删除指定主键的批次信息表
        /// </summary>
        /// <param name="groupID">批次号</param>
        /// <returns>成功/失败</returns>
        public bool Delete(Guid groupID)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("delete from GroupInfo where GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", groupID, SqlDbType.UniqueIdentifier));
            stmt.StatementType = SqlStatementType.Delete;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 更新批次信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(GroupInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update GroupInfo set ");
            stmt.AppendString("GroupName=");
            stmt.AppendParameter(_session.MakeInParameter("GroupName", dao.GroupName, SqlDbType.NVarChar));
            stmt.AppendString(",StartTime=");
            stmt.AppendParameter(_session.MakeInParameter("StartTime", dao.StartTime, SqlDbType.DateTime));
            stmt.AppendString(",OperatorName=");
            stmt.AppendParameter(_session.MakeInParameter("OperatorName", dao.OperatorName, SqlDbType.NVarChar));
            stmt.AppendString(",IsSuccessed=");
            stmt.AppendParameter(_session.MakeInParameter("IsSuccessed", dao.IsSuccessed, SqlDbType.Bit));
            stmt.AppendString(" where ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 获取指定的站内轨道区段与道岔映射表
        /// </summary>
        /// <param name="sectionName">区段名称</param>
        /// <param name="stationName">车站名称</param>
        /// <returns>站内轨道区段与道岔映射表</returns>
        public StationSectionMapping SelectOne(string sectionName, string stationName)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from StationSectionMapping where ");
            stmt.AppendString("SectionName=");
            stmt.AppendParameter(_session.MakeInParameter("SectionName", sectionName, SqlDbType.NVarChar));
            stmt.AppendString(" and StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", stationName, SqlDbType.NVarChar));
            stmt.StatementType = SqlStatementType.Select;
            SqlResult             result = _session.Excecute(stmt);
            StationSectionMapping stationSectionMapping = new StationSectionMapping();

            if (result.RowsAffected > 0)
            {
                DataRowToEntity(result.Tables[0].Rows[0], stationSectionMapping);
            }
            return(stationSectionMapping);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 获取指定的道岔信息表
        /// </summary>
        /// <param name="stationName">车站名称</param>
        /// <param name="turnoutName">道岔名称</param>
        /// <returns>道岔信息表</returns>
        public TurnoutInfo SelectOne(string stationName, int turnoutName)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TurnoutInfo where ");
            stmt.AppendString("StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", stationName, SqlDbType.NVarChar));
            stmt.AppendString(" and TurnoutName=");
            stmt.AppendParameter(_session.MakeInParameter("TurnoutName", turnoutName, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Select;
            SqlResult   result      = _session.Excecute(stmt);
            TurnoutInfo turnoutInfo = new TurnoutInfo();

            if (result.RowsAffected > 0)
            {
                DataRowToEntity(result.Tables[0].Rows[0], turnoutInfo);
            }
            return(turnoutInfo);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 更新站内轨道区段与道岔映射表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(StationSectionMapping dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update StationSectionMapping set ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.AppendString(",GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",TurnoutIDs=");
            stmt.AppendParameter(_session.MakeInParameter("TurnoutIDs", dao.TurnoutIDs, SqlDbType.NVarChar));
            stmt.AppendString(" where ");
            stmt.AppendString("SectionName=");
            stmt.AppendParameter(_session.MakeInParameter("SectionName", dao.SectionName, SqlDbType.NVarChar));
            stmt.AppendString(" and StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 新增制动距离信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Insert(BrakingInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("insert into BrakingInfo(GroupID,Speed,Gradient,LengthFor300T,LengthForPulling,LengthForMessage) values (");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Speed", dao.Speed, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("Gradient", dao.Gradient, SqlDbType.Decimal));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LengthFor300T", dao.LengthFor300T, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LengthForPulling", dao.LengthForPulling, SqlDbType.Int));
            stmt.AppendString(",");
            stmt.AppendParameter(_session.MakeInParameter("LengthForMessage", dao.LengthForMessage, SqlDbType.Int));
            stmt.AppendString(");select SCOPE_IDENTITY();");
            stmt.StatementType = SqlStatementType.Identity;
            SqlResult result = _session.Excecute(stmt);

            if (result.Data != null)
            {
                dao.ID = int.Parse(result.Data.ToString());
                return(true);
            }
            return(false);
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 获取指定的坐标系信息表
        /// </summary>
        /// <param name="iD">顺序号</param>
        /// <returns>坐标系信息表</returns>
        public CoordinateInfo SelectOne(int iD)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from CoordinateInfo where ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", iD, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Select;
            SqlResult      result         = _session.Excecute(stmt);
            CoordinateInfo coordinateInfo = new CoordinateInfo();

            if (result.RowsAffected > 0)
            {
                DataRowToEntity(result.Tables[0].Rows[0], coordinateInfo);
            }
            return(coordinateInfo);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 获取指定的应答器位置
        /// </summary>
        /// <param name="iD">顺序号</param>
        /// <returns>应答器位置</returns>
        public TransponderLocation SelectOne(int iD)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TransponderLocation where ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", iD, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Select;
            SqlResult           result = _session.Excecute(stmt);
            TransponderLocation transponderLocation = new TransponderLocation();

            if (result.RowsAffected > 0)
            {
                DataRowToEntity(result.Tables[0].Rows[0], transponderLocation);
            }
            return(transponderLocation);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 获取指定的批次信息表
        /// </summary>
        /// <param name="groupID">批次号</param>
        /// <returns>批次信息表</returns>
        public GroupInfo SelectOne(Guid groupID)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from GroupInfo where GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", groupID, SqlDbType.UniqueIdentifier));
            stmt.StatementType = SqlStatementType.Select;
            SqlResult result    = _session.Excecute(stmt);
            GroupInfo groupInfo = new GroupInfo();

            if (result.RowsAffected > 0)
            {
                DataRowToEntity(result.Tables[0].Rows[0], groupInfo);
            }
            return(groupInfo);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 更新制动距离信息表
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(BrakingInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update BrakingInfo set ");
            stmt.AppendString("GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",Speed=");
            stmt.AppendParameter(_session.MakeInParameter("Speed", dao.Speed, SqlDbType.Int));
            stmt.AppendString(",Gradient=");
            stmt.AppendParameter(_session.MakeInParameter("Gradient", dao.Gradient, SqlDbType.Decimal));
            stmt.AppendString(",LengthFor300T=");
            stmt.AppendParameter(_session.MakeInParameter("LengthFor300T", dao.LengthFor300T, SqlDbType.Int));
            stmt.AppendString(",LengthForPulling=");
            stmt.AppendParameter(_session.MakeInParameter("LengthForPulling", dao.LengthForPulling, SqlDbType.Int));
            stmt.AppendString(",LengthForMessage=");
            stmt.AppendParameter(_session.MakeInParameter("LengthForMessage", dao.LengthForMessage, SqlDbType.Int));
            stmt.AppendString(" where ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 更新车站信息
        /// </summary>
        /// <param name="dao">数据对象</param>
        /// <returns>成功/失败</returns>
        public bool Update(StationInfo dao)
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("update StationInfo set ");
            stmt.AppendString("ID=");
            stmt.AppendParameter(_session.MakeInParameter("ID", dao.ID, SqlDbType.Int));
            stmt.AppendString(",GroupID=");
            stmt.AppendParameter(_session.MakeInParameter("GroupID", dao.GroupID, SqlDbType.UniqueIdentifier));
            stmt.AppendString(",RegionID=");
            stmt.AppendParameter(_session.MakeInParameter("RegionID", dao.RegionID, SqlDbType.Int));
            stmt.AppendString(",AreaID=");
            stmt.AppendParameter(_session.MakeInParameter("AreaID", dao.AreaID, SqlDbType.Int));
            stmt.AppendString(",StationID=");
            stmt.AppendParameter(_session.MakeInParameter("StationID", dao.StationID, SqlDbType.Int));
            stmt.AppendString(" where ");
            stmt.AppendString("StationName=");
            stmt.AppendParameter(_session.MakeInParameter("StationName", dao.StationName, SqlDbType.NVarChar));
            stmt.StatementType = SqlStatementType.Update;
            return(_session.Excecute(stmt).RowsAffected > 0);
        }