private void DeleteBusStopsOnLine(BusStopOnLine[] bsol)
 {
     foreach(BusStopOnLine item in bsol)
     {
         BusStopOnLineSecureService.DeleteById(item.Id.Value);
     }
 }
        private BusStop[] ConvertToBusStop(BusStopOnLine[] bsolArray)
        {
            List<BusStop> resultArray = new List<BusStop>();

            foreach(BusStopOnLine item in bsolArray)
            {
                resultArray.Add(BusStopService.GetById(item.BusStopId));
            }

            return resultArray.ToArray();
        }
        private void AddBusStopsOnLine(int id)
        {
            foreach (BusStop busStop in ActualBusStops.Items)
            {
                BusStopOnLine newBusStopOnLine = new BusStopOnLine();
                newBusStopOnLine.LineId = id;
                newBusStopOnLine.NumberStopOnLine = ActualBusStops.Items.IndexOf(busStop) + 1;

                if (RelationTextBox.SelectedIndex == 0)
                {
                    newBusStopOnLine.Direction = true;
                }
                else
                {
                    newBusStopOnLine.Direction = false;
                }

                newBusStopOnLine.BusStopId = busStop.Id.Value;
                BusStopOnLineSecureService.Create(newBusStopOnLine);
            }

            foreach (BusStop busStop in ActualBusStops.Items)
            {
                BusStopOnLine newBusStopOnLine = new BusStopOnLine();
                newBusStopOnLine.LineId = id;
                newBusStopOnLine.NumberStopOnLine = ActualBusStops.Items.IndexOf(busStop) + 1;

                if (RelationTextBox.SelectedIndex == 1)
                {
                    newBusStopOnLine.Direction = true;
                }
                else
                {
                    newBusStopOnLine.Direction = false;
                }

                newBusStopOnLine.BusStopId = busStop.Id.Value;
                BusStopOnLineSecureService.Create(newBusStopOnLine);
            }
        }
        private BusStopOnLine[] GetbyLineId(int lineId, BusStopOnLine[] allBusStops)
        {
            List<BusStopOnLine> resultArray = new List<BusStopOnLine>();

            foreach(BusStopOnLine item in allBusStops)
            {
                if(item.LineId == lineId)
                {
                    resultArray.Add(item);
                }
            }

            return resultArray.ToArray();
        }