示例#1
0
        public static void Update(VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE lane)
        {
            try
            {
                string    spName  = VaaaN.MLFF.Libraries.CommonLibrary.Constants.oraclePackagePrefix + "LANE_UPDATE";
                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);

                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TMS_ID", DbType.Int32, lane.TMSId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_PLAZA_ID", DbType.Int32, lane.PlazaId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_ID", DbType.Int32, lane.LaneId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_TYPE_ID", DbType.Int32, lane.LaneTypeId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_NAME", DbType.String, lane.LaneName, ParameterDirection.Input, 50));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_CAMERA_ID_FRONT", DbType.Int32, lane.CameraIdFront, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_CAMERA_ID_REAR", DbType.Int32, lane.CameraIdRear, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_ETC_ANTENNA_ID_FRONT", DbType.Int32, lane.AntennaIdFront, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_ETC_ANTENNA_ID_REAR", DbType.Int32, lane.AntennaIdRear, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MODIFIED_BY", DbType.Int32, lane.ModifierId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_MODIFICATION_DATE", DbType.DateTime, lane.ModificationDate, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TRANSFER_STATUS", DbType.Int32, lane.TransferStatus, ParameterDirection.Input));
                VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.ExecuteNonQuery(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        public static int Insert(VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE lane)
        {
            int laneId = lane.LaneId;

            try
            {
                string spName = VaaaN.MLFF.Libraries.CommonLibrary.Constants.oraclePackagePrefix + "LANE_INSERT";

                DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName);

                if (laneId <= 0)
                {
                    laneId = GetNextValue();
                }
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TMS_ID", DbType.Int32, lane.TMSId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_PLAZA_ID", DbType.Int32, lane.PlazaId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_ID", DbType.Int32, laneId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_TYPE_ID", DbType.Int32, lane.LaneTypeId, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LANE_NAME", DbType.String, lane.LaneName, ParameterDirection.Input, 50));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_CAMERA_ID_FRONT", DbType.Int32, lane.CameraIdFront, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_CAMERA_ID_REAR", DbType.Int32, lane.CameraIdRear, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_ETC_ANTENNA_ID_FRONT", DbType.Int32, lane.AntennaIdFront, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_ETC_ANTENNA_ID_REAR", DbType.Int32, lane.AntennaIdRear, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_CREATION_DATE", DbType.DateTime, lane.CreationDate, ParameterDirection.Input));
                command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TRANSFER_STATUS", DbType.Int32, lane.TransferStatus, ParameterDirection.Input));
                VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.ExecuteNonQuery(command);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(laneId);
        }
示例#3
0
 public static void Update(VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE lane)
 {
     VaaaN.MLFF.Libraries.CommonLibrary.DAL.LaneDAL.Update(lane);
 }
示例#4
0
 public static int Insert(VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE lane)
 {
     return(VaaaN.MLFF.Libraries.CommonLibrary.DAL.LaneDAL.Insert(lane));
 }
示例#5
0
        private static VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCollection ConvertDataTableToCollection(DataTable dt)
        {
            try
            {
                VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCollection lanes = new VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCollection();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE lane = new VaaaN.MLFF.Libraries.CommonLibrary.CBE.LaneCBE();

                    if (dt.Rows[i]["TMS_ID"] != DBNull.Value)
                    {
                        lane.TMSId = Convert.ToInt32(dt.Rows[i]["TMS_ID"]);
                    }

                    if (dt.Rows[i]["PLAZA_ID"] != DBNull.Value)
                    {
                        lane.PlazaId = Convert.ToInt32(dt.Rows[i]["PLAZA_ID"]);
                    }

                    if (dt.Rows[i]["PLAZA_NAME"] != DBNull.Value)
                    {
                        lane.PlazaName = Convert.ToString(dt.Rows[i]["PLAZA_NAME"]);
                    }

                    if (dt.Rows[i]["LANE_ID"] != DBNull.Value)
                    {
                        lane.LaneId = Convert.ToInt32(dt.Rows[i]["LANE_ID"]);
                    }

                    if (dt.Rows[i]["LANE_TYPE_ID"] != DBNull.Value)
                    {
                        lane.LaneTypeId = Convert.ToInt32(dt.Rows[i]["LANE_TYPE_ID"]);
                    }

                    if (dt.Rows[i]["LANE_NAME"] != DBNull.Value)
                    {
                        lane.LaneName = Convert.ToString(dt.Rows[i]["LANE_NAME"]);
                    }

                    if (dt.Rows[i]["CAMERA_ID_FRONT"] != DBNull.Value)
                    {
                        lane.CameraIdFront = Convert.ToInt32(dt.Rows[i]["CAMERA_ID_FRONT"]);
                    }

                    if (dt.Rows[i]["CAMERA_NAME_FRONT"] != DBNull.Value)
                    {
                        lane.CameraNameFront = Convert.ToString(dt.Rows[i]["CAMERA_NAME_FRONT"]);
                    }

                    if (dt.Rows[i]["CAMERA_ID_REAR"] != DBNull.Value)
                    {
                        lane.CameraIdRear = Convert.ToInt32(dt.Rows[i]["CAMERA_ID_REAR"]);
                    }

                    if (dt.Rows[i]["CAMERA_NAME_REAR"] != DBNull.Value)
                    {
                        lane.CameraNameRear = Convert.ToString(dt.Rows[i]["CAMERA_NAME_REAR"]);
                    }

                    if (dt.Rows[i]["ETC_ANTENNA_ID_FRONT"] != DBNull.Value)
                    {
                        lane.AntennaIdFront = Convert.ToInt32(dt.Rows[i]["ETC_ANTENNA_ID_FRONT"]);
                    }

                    if (dt.Rows[i]["ETC_ANTENNA_ID_REAR"] != DBNull.Value)
                    {
                        lane.AntennaIdRear = Convert.ToInt32(dt.Rows[i]["ETC_ANTENNA_ID_REAR"]);
                    }

                    if (dt.Rows[i]["ETC_ANTENNA_NAME_FRONT"] != DBNull.Value)
                    {
                        lane.EtcAntennaNameFront = Convert.ToString(dt.Rows[i]["ETC_ANTENNA_NAME_FRONT"]);
                    }

                    if (dt.Rows[i]["ETC_ANTENNA_NAME_REAR"] != DBNull.Value)
                    {
                        lane.EtcAntennaNameRear = Convert.ToString(dt.Rows[i]["ETC_ANTENNA_NAME_REAR"]);
                    }

                    if (dt.Rows[i]["CREATION_DATE"] != DBNull.Value)
                    {
                        lane.CreationDate = Convert.ToDateTime(dt.Rows[i]["CREATION_DATE"]);
                    }

                    if (dt.Rows[i]["MODIFICATION_DATE"] != DBNull.Value)
                    {
                        lane.ModificationDate = Convert.ToDateTime(dt.Rows[i]["MODIFICATION_DATE"]);
                    }

                    if (dt.Rows[i]["MODIFIED_BY"] != DBNull.Value)
                    {
                        lane.ModifierId = Convert.ToInt32(dt.Rows[i]["MODIFIED_BY"]);
                    }

                    if (dt.Rows[i]["TRANSFER_STATUS"] != DBNull.Value)
                    {
                        lane.TransferStatus = Convert.ToInt32(dt.Rows[i]["TRANSFER_STATUS"]);
                    }

                    lanes.Add(lane);
                }
                return(lanes);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }