public BurialsViewModel(SupervisorModel model, IBurialService apiBurial) { if (CrossConnectivity.Current.IsConnected) { _apiBurial = apiBurial; _supervisor = model; SupervisorId = model.SupervisorId; _burialList = new List <BurialModel>(); _refreshCommand = new Command(async() => await RefreshList(model)); _sqLiteConnection = DependencyService.Get <ISQLite>().GetConnection(); _sqLiteConnection.CreateTable <Burial>(); _onTapGestureRecognizerTapped = new Command(OnTapped); OutputAgeCommand = new Command <BurialModel>(OutputAge); Reload(); } else { Device.BeginInvokeOnMainThread(() => { Application.Current.MainPage.DisplayAlert("Error Network Connection", "You need to be connected to the internet and restart the application", "OK"); IsBusy = false; }); } }
public Burials(SupervisorModel model, IBurialService apiBurial) { InitializeComponent(); this._model = model; _apiBurial = apiBurial; lblFullname.Text = model.Fullname; BindingContext = _burialViewModel = new BurialsViewModel(model, apiBurial); }
public void Setup() { var options = new DbContextOptionsBuilder <PsuHistoryDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); _dbContext = new PsuHistoryDbContext(options.Options); _service = new BurialService(_dbContext); }
public Undertaker(BurialModelOutPut burialOutPut, IBurialService apiBurial) { InitializeComponent(); _apiBurial = apiBurial; BindingContext = _undertakerViewModel = new UndertakerViewModel(burialOutPut, _apiBurial); lblUndertakerName.Text = burialOutPut.Undertaker; lblAccessCounter.Text = burialOutPut.AccessCount.ToString(); lblDeceasedDetails.Text = burialOutPut.DeceasedDetails; _sqLiteConnection = DependencyService.Get <ISQLite>().GetConnection(); }
public UndertakerViewModel(BurialModelOutPut burialOutPut, IBurialService apiBurial) { _burialOutPut = burialOutPut; _sqLiteConnection = DependencyService.Get <ISQLite>().GetConnection(); _sqLiteConnection.CreateTable <Burial>(); if (_burialOutPut.BurialApplication != 0) { _burialApplication = _burialOutPut.BurialApplication; _supervisor = new SupervisorModel { CemeteryId = burialOutPut.CemeteryId, SupervisorId = burialOutPut.SupervisorId, Name = burialOutPut.Name, Surname = burialOutPut.Surname }; } _apiBurial = apiBurial; }
public LoginViewModel(IAuthService apiServices, ICemeteryService apiCemetery, IBurialService apiBurial) { _apiServices = apiServices; _apiCemetery = apiCemetery; _apiBurial = apiBurial; }