public override void OnAppearing() { UserDialogs.Instance.ShowLoading(); Device.BeginInvokeOnMainThread(async () => { History.Clear(); var x = await Requestrepo.GetAllAsync(); foreach (var item in x) { var temp = new RequestDTO(); temp.CarId = item.CarId; var car = await Carrepository.GetByIdAsync(item.CarId); temp.CarModel = car.Model; temp.Price = item.Price; temp.AddedDate = item.AddedDate; if (item.DriverId > 0) { temp.DriverId = item.DriverId; var driver = await DriverRepo.GetByIdAsync((int)item.DriverId); temp.Drivername = driver.Name; } else { temp.Drivername = "No Driver"; } History.Add(temp); } UserDialogs.Instance.HideLoading(); }); base.OnAppearing(); }
public override Task Init(object args) { UserDialogs.Instance.ShowLoading(); Task.Run(async () => { var x = await Requestrepo.GetAllAsync(); foreach (var item in x) { var temp = new RequestDTO(); temp.CarId = item.CarId; var car = await Carrepository.GetByIdAsync(item.CarId); temp.CarModel = car.Model; temp.Price = item.Price; temp.AddedDate = item.AddedDate; if (item.DriverId > 0) { temp.DriverId = item.DriverId; var driver = await DriverRepo.GetByIdAsync((int)item.DriverId); temp.Drivername = driver.Name; } else { temp.Drivername = "No Driver"; } History.Add(temp); } UserDialogs.Instance.HideLoading(); }); return base.Init(args); }
public override void OnAppearing() { UserDialogs.Instance.ShowLoading(); Device.BeginInvokeOnMainThread(async() => { var x = await Carrepository.GetAllAsync(); foreach (var item in x) { if (!Cars.Contains(item)) { Cars.Add(item); } } var d = await DriverRepo.GetAllAsync(); foreach (var item in d) { if (!Drivers.Contains(item)) { Drivers.Add(item); } } UserDialogs.Instance.HideLoading(); }); base.OnAppearing(); }
public DALUnitOfWork() { vygCtx = new VoyageContext(); BusExpeditionPocos = new BusExpeditionRepo(vygCtx); BusPocos = new BusRepo(vygCtx); BusTypePocos = new BusTypeRepo(vygCtx); DriverPocos = new DriverRepo(vygCtx); HostPocos = new HostRepo(vygCtx); PersonPocos = new PersonRepo(vygCtx); RoutePocos = new RouteRepo(vygCtx); SeatInformationPocos = new SeatInformationRepo(vygCtx); TicketPocos = new TicketRepo(vygCtx); }
private async void orderAsync(object obj) { UserDialogs.Instance.ShowLoading(); Request x = new Request() { CarId = SelectedCar.Id, UserId = App.ActiveUser.Id, Price = 50.0 }; if (WithDriver) { x.DriverId = SelectedDriver.Id; x.Price = 78.5; SelectedDriver.IsAvailable = false; await DriverRepo.UpdateAsync(SelectedDriver); } var l = Requestrepo.InsertAsync(x); SelectedCar.IsAvailable = false; await Carrepository.UpdateAsync(SelectedCar); UserDialogs.Instance.HideLoading(); AlertConfig alert = new AlertConfig(); alert.Title = "Payment Confirmation"; alert.Message = "Just Confirming You are Paying " + x.Price + "with your CreditCard"; alert.OkText = "Pay"; UserDialogs.Instance.Alert(alert); UserDialogs.Instance.ShowLoading(); var cardrepo = new CreditcardRepository(App.DbPath); await cardrepo.UpdateAsync(App.ActiveUser.CrieditCard); UserDialogs.Instance.HideLoading(); alert.Title = "Sucess"; alert.Message = "Done , Your Balance is " + (App.ActiveUser.CrieditCard.Balance - x.Price); UserDialogs.Instance.Alert(alert); }
public DriversGet(DriverRepo driverRepo) { _driverRepo = driverRepo; }
public DriverTests() { _db = new RushHourContext(); _repo = new DriverRepo(); CleanDatabase(); }
public OrdersPut(DriverRepo driverRepo) { _driverRepo = driverRepo; }