Ejemplo n.º 1
0
 void IDAL.AddLineExit(LineExit lineExit)
 {
     if (DataSource.LineExits.Exists(lineExit1 => lineExit1.BusLineID1 == lineExit.BusLineID1 && lineExit1.LineStartTime == lineExit.LineStartTime))
     {
         throw new ExceptionLineExit(lineExit.BusLineID1, lineExit.LineStartTime, "the LineExit alrdy exist in the list in the same time");
     }
     else
     {
         DataSource.LineExits.Add(lineExit.Clone());
     }
 }
Ejemplo n.º 2
0
        LineExit IDAL.OneLineExitFromList(int numberLine, TimeSpan StartTime)
        {
            LineExit b = DataSource.LineExits.FirstOrDefault(lineExit => lineExit.BusLineID1 == numberLine && lineExit.LineStartTime == StartTime);

            return(b = default ? throw new ExceptionLineExit(numberLine, StartTime, "the line Exit dsnt Exist") : b);
Ejemplo n.º 3
0
        LineExit IDAL.ReturnLineExit(int lineNumber, TimeSpan StartTime)
        {
            LineExit lineExit = DataSource.LineExits.FirstOrDefault(lineExit1 => lineExit1.BusLineID1 == lineNumber && lineExit1.LineStartTime == StartTime);

            return(lineExit.Clone() ?? throw new ExceptionLineExit(lineNumber, StartTime, "the LineExit not exist in the list"));
        }
Ejemplo n.º 4
0
        void IDAL.UpdatingLineExit(LineExit lineExit)
        {
            int index = DataSource.LineExits.FindIndex(lineExit1 => lineExit1.BusLineID1 == lineExit.BusLineID1 && lineExit1.LineStartTime == lineExit.LineStartTime);

            DataSource.LineExits[index] = index == -1 ? throw new ExceptionLineExit(lineExit.BusLineID1, lineExit.LineStartTime, "The lineExit not exist in the compny") : lineExit.Clone();
        }
Ejemplo n.º 5
0
        LineExit IDAL.OneLineExitFromList(int numberLine, string start)
        {
            LineExit b = DataSource.LineExits.FirstOrDefault(lineExit => lineExit.BusLineID1 == numberLine && lineExit.LineStartTime == start);

            return(b = default ? throw new ExceptionDl("the line Exit dsnt Exist") : b);