public BusStopDetails(ClientCredentials clientCredentials)
        {
            InitializeComponent();
            ActualBusStop = new BusStop();

            busStopService = new BusStopServiceClient();

            busStopSecureService = new BusStopSecureServiceClient();
            busStopSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            busStopTypeService = new BusStopTypeServiceClient();
            busStopTypeService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopTypeService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            busStopTypeSecureService = new BusStopTypeSecureServiceClient();
            busStopTypeSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopTypeSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            BusStopTypeComboBox.ItemsSource = busStopTypeService.GetAll();

            OpenAllTextBoxes();
            SaveButton.IsEnabled = true;
            EditButton.IsEnabled = false;
            DeleteButton.IsEnabled = false;

            IsAddingNewObject = true;
        }
        public BusStopServiceConfiguration()
        {
            BasicHttpBinding httpBinding = new BasicHttpBinding();

            BusStopServiceClient =
                new BusStopServiceClient(httpBinding, EndPoints.BusStopOnLineService);
        }
        public BusStopControl(ClientCredentials clientCredentials)
        {
            InitializeComponent();

            BusStopService = new BusStopServiceClient();
            BusStopService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            BusStopService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

        }
        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 BusStopDetails(ClientCredentials clientCredentials, BusStop busStop)
        {
            InitializeComponent();
            ActualBusStop = busStop;

            busStopService = new BusStopServiceClient();

            busStopSecureService = new BusStopSecureServiceClient();
            busStopSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            busStopTypeService = new BusStopTypeServiceClient();
            busStopTypeService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopTypeService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            busStopTypeSecureService = new BusStopTypeSecureServiceClient();
            busStopTypeSecureService.ClientCredentials.UserName.UserName = clientCredentials.UserName.UserName;
            busStopTypeSecureService.ClientCredentials.UserName.Password = clientCredentials.UserName.Password;

            BusStopTypeComboBox.ItemsSource = busStopTypeService.GetAll();
            FillData();
            SaveButton.IsEnabled = false;
        }
        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;
        }
 public BusStopProvider()
 {
     _busStopClient = new BusStopServiceClient();
     _busStopOnLineClient = new BusStopOnLineServiceClient();
 }