public BusScheduleDetails(ClientCredentials clientCredentials)
        {
            InitializeComponent();
            SelectedLine = new Line();
            BusStopService = new BusStopServiceClient();
            LineService = new LineServiceClient();
            LineSecureService = new LineSecureServiceClient();
            LineSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            LineSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;
            BusStopOnLineSecureService = new BusStopOnLineSecureServiceClient();
            BusStopOnLineSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            BusStopOnLineSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            FillListView(BusStopService.GetAll(),AllBusStops);

            DeleteButton.IsEnabled = false;
            EditButton.IsEnabled = false;

            SetEnabled();
            BlockListButtons();
            IsNewObjectEnable = true;
        }
        public BusScheduleDetails(ClientCredentials clientCredentials, Line line)
        {
            InitializeComponent();

            BusStopService = new BusStopServiceClient();
            BusStopOnLineService = new BusStopOnLineServiceClient();
            LineService = new LineServiceClient();
            LineSecureService = new LineSecureServiceClient();
            LineSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            LineSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;
            BusStopOnLineSecureService = new BusStopOnLineSecureServiceClient();
            BusStopOnLineSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            BusStopOnLineSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            this.SelectedLine = line;
            SelectedBSOL = GetbyLineId(line.Id.Value, BusStopOnLineService.GetAll().Where(bsol=>bsol.Direction==true).ToArray());

            LineNumberTextBox.Text = line.Name;

            SelectedBusStopArray = ConvertToBusStop(SelectedBSOL);
            FillListView(BusStopService.GetAll(), AllBusStops);
            FillListView(SelectedBusStopArray, ActualBusStops);
            SetRelations();
            if(SelectedBSOL.First().Direction)
            {
                RelationTextBox.SelectedIndex = 0;
            }
            else
            {
                RelationTextBox.SelectedIndex = 1;
            }

            BlockButtons();

            SaveButton.IsEnabled = false;
            IsNewObjectEnable = false;
        }