public CarsOrderViewModel(StationDTO station,CustomerDTO w) { this.station = station; this.w = w; SearchCars(); CarAmount = 0; }
public void GetAllStations_ShouldReturnAllStationsTest() { StationDTO[] stations = new StationDTO[5]; var mockRepository = new Mock<IStationRepository>(); mockRepository.Setup(x => x.GetAll()).Returns(new StationDTO[stations.Count()]); var controller = new StationController(mockRepository.Object); var result = controller.Get() as OkNegotiatedContentResult<IEnumerable<StationDTO>>; Assert.AreEqual(stations.Count(), result.Content.Count()); }
public void Update(StationDTO item) { var st = entities.Stations.FirstOrDefault(s => s.Id == item.Id); if (st != null) { st.city = item.city; st.street = item.street; st.streetNumer = item.streetNumer; st.zipCode = item.zipCode; entities.SaveChanges(); } }
public CarsOrderView(StationDTO s,CustomerDTO w) { InitializeComponent(); DataContext = new CarsOrderViewModel(s,w); }
private async void Accept() { Validate(); if (validationErrors.Count == 0) { int no; if (Int32.TryParse(StreetNo, out no)) { var sDTO = new StationDTO(); sDTO.streetNumer = no; sDTO.city = City; sDTO.street = Street; sDTO.zipCode = zipCode; var service = new Mobilek.Services.StationDTOService(w.login,w.password); await service.Post(sDTO); } var msg = new FireRefresh(); Messenger.Default.Send<FireRefresh>(msg); Exit(); } }
public string EditStation(StationDTO objTodo) { string msg; try { if (ModelState.IsValid) { var carpost = Task.Run((() => _stationjDtoService.Put(objTodo))).Result; msg = Messages.SuccessAdd; } else { msg = Messages.ValidationFail; } } catch (Exception ex) { msg = Messages.ErrorOccured + ex.Message; } return msg; }
public StationEditView(StationDTO s,WorkerDTO w) { InitializeComponent(); DataContext = new StationEditViewModel(s,w); }
private async void Accept() { int no; if (Int32.TryParse(StreetNo, out no)) { StationDTO toUpdate = new StationDTO() { Id = selected.Id, city = City, street = Street, zipCode = ZipCode, streetNumer = no }; var service = new StationDTOService(w.login,w.password); await service.Put(toUpdate); } var msg = new FireRefresh(); Messenger.Default.Send<FireRefresh>(msg); Exit(); }
public StationEditViewModel(StationDTO e,WorkerDTO w) { City = e.city; Street = e.street; ZipCode = e.zipCode; StreetNo = e.streetNumer.ToString(); selected = e; this.w = w; }
public void Add(StationDTO item) { entities.Stations.Add(Mapper.Map<Station>(item)); entities.SaveChanges(); }
public async Task<bool> Put(StationDTO item) { return await this.Put<StationDTO, bool > ("PUT", item); }
public async Task<bool> Post(StationDTO item) { return await this.Post<StationDTO, bool>("POST", item); }