예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
예제 #7
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);
        }
예제 #8
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);
        }
예제 #9
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);
        }
예제 #10
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);
        }
예제 #11
0
        /// <summary>
        /// 获取所有的应答器位置
        /// </summary>
        /// <returns>所有信息</returns>
        public SqlResult SelectAll()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TransponderLocation");
            stmt.StatementType = SqlStatementType.Select;
            return(_session.Excecute(stmt));
        }
예제 #12
0
        /// <summary>
        /// 获取所有的站内轨道区段与道岔映射表
        /// </summary>
        /// <returns>所有信息</returns>
        public SqlResult SelectAll()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from StationSectionMapping");
            stmt.StatementType = SqlStatementType.Select;
            return(_session.Excecute(stmt));
        }
예제 #13
0
        /// <summary>
        /// 获取按主键排序的所有应答器位置
        /// </summary>
        /// <returns>Sql语句块</returns>
        public SqlStatement SelectAllSqlStatementOrder()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TransponderLocation order by ID");
            stmt.StatementType = SqlStatementType.Select;
            return(stmt);
        }
예제 #14
0
        /// <summary>
        /// 获取所有的线路速度表
        /// </summary>
        /// <returns>Sql语句块</returns>
        public SqlStatement SelectAllSqlStatement()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from SpeedInfo");
            stmt.StatementType = SqlStatementType.Select;
            return(stmt);
        }
예제 #15
0
        /// <summary>
        /// 获取按主键排序的所有站内轨道区段与道岔映射表
        /// </summary>
        /// <returns>Sql语句块</returns>
        public SqlStatement SelectAllSqlStatementOrder()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from StationSectionMapping order by SectionName,StationName");
            stmt.StatementType = SqlStatementType.Select;
            return(stmt);
        }
예제 #16
0
        /// <summary>
        /// 获取所有的坐标系信息表
        /// </summary>
        /// <returns>所有信息</returns>
        public SqlResult SelectAll()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from CoordinateInfo");
            stmt.StatementType = SqlStatementType.Select;
            return(_session.Excecute(stmt));
        }
예제 #17
0
        /// <summary>
        /// 获取按主键排序的所有坐标系信息表
        /// </summary>
        /// <returns>Sql语句块</returns>
        public SqlStatement SelectAllSqlStatementOrder()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from CoordinateInfo order by ID");
            stmt.StatementType = SqlStatementType.Select;
            return(stmt);
        }
예제 #18
0
        /// <summary>
        /// 获取按主键排序的所有道岔信息表
        /// </summary>
        /// <returns>Sql语句块</returns>
        public SqlStatement SelectAllSqlStatementOrder()
        {
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TurnoutInfo order by StationName,TurnoutName");
            stmt.StatementType = SqlStatementType.Select;
            return(stmt);
        }
예제 #19
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);
        }
예제 #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);
        }
예제 #21
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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #24
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);
        }
예제 #25
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);
        }
예제 #26
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);
        }
예제 #27
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);
        }
예제 #28
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);
        }
예제 #29
0
        /// <summary>
        /// 获取所有的坐标系信息表集合
        /// </summary>
        /// <returns>所有信息</returns>
        public ObservableCollection <CoordinateInfo> SelectAllCollection()
        {
            ObservableCollection <CoordinateInfo> datas = new ObservableCollection <CoordinateInfo>();
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from CoordinateInfo");
            stmt.StatementType = SqlStatementType.Select;
            GenDataReader reader = _session.ExcecuteReader(stmt);

            while (reader.Read())
            {
                CoordinateInfo dao = new CoordinateInfo();
                DataReaderToEntity(reader, dao);
                datas.Add(dao);
            }
            reader.Close();
            return(datas);
        }
예제 #30
0
        /// <summary>
        /// 获取所有的应答器位置集合
        /// </summary>
        /// <returns>所有信息</returns>
        public ObservableCollection <TransponderLocation> SelectAllCollection()
        {
            ObservableCollection <TransponderLocation> datas = new ObservableCollection <TransponderLocation>();
            SqlStatement stmt = _session.CreateSqlStatement();

            stmt.AppendString("select * from TransponderLocation");
            stmt.StatementType = SqlStatementType.Select;
            GenDataReader reader = _session.ExcecuteReader(stmt);

            while (reader.Read())
            {
                TransponderLocation dao = new TransponderLocation();
                DataReaderToEntity(reader, dao);
                datas.Add(dao);
            }
            reader.Close();
            return(datas);
        }