public void Add(Action<FuelReportDto, Exception> action, FuelReportDto ent) { var url = string.Format(fuelReportAddressFormatString, string.Empty); WebClientHelper.Post<FuelReportDto, FuelReportDto>(new Uri(url, UriKind.Absolute), (res, exp) => action(res, exp), ent, WebClientHelper.MessageFormat.Json,ApiConfig.Headers); }
public void SetEntity(FuelReportDto entity) { this.Entity = entity; this.GetVoyages(); }
public void Load(FuelReportDto ent) { this.ShowBusyIndicator("درحال دریافت اطلاعات گزارش"); this.serviceWrapper.GetById((res, exp) => this.mainController.BeginInvokeOnDispatcher(() => { if (exp == null) { this.Entity = res; this.ReportType = this.Entity.FuelReportType.ToString(); this.GetVoyages(); } else { this.mainController.HandleException(exp); } this.HideBusyIndicator(); }), ent.Id); }
public void Edit(FuelReportDto dto) { var view = ViewManager.ShowInDialog<IFuelReportView>(); (view.ViewModel as FuelReportVM).Load(dto); }
//================================================================================ public FuelReportDto Add(FuelReportDto data) { throw new NotImplementedException(); }
//================================================================================ public FuelReportDto Update(FuelReportDto fuelReportDto) { if (fuelReportDto.Voyage == null) throw new InvalidArgument("fuelReportDto.Voyage"); var updatedFuelReport = this.appService.UpdateVoyageId( fuelReportDto.Id, fuelReportDto.Voyage.Id); var updatedDto = fuelReportMapper.MapToModel(updatedFuelReport); return updatedDto; }