Ejemplo n.º 1
0
        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;
                });
            }
        }
Ejemplo n.º 2
0
 public Burials(SupervisorModel model, IBurialService apiBurial)
 {
     InitializeComponent();
     this._model      = model;
     _apiBurial       = apiBurial;
     lblFullname.Text = model.Fullname;
     BindingContext   = _burialViewModel = new BurialsViewModel(model, apiBurial);
 }
Ejemplo n.º 3
0
        public void Setup()
        {
            var options = new DbContextOptionsBuilder <PsuHistoryDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);

            _dbContext = new PsuHistoryDbContext(options.Options);
            _service   = new BurialService(_dbContext);
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 6
0
 public LoginViewModel(IAuthService apiServices, ICemeteryService apiCemetery, IBurialService apiBurial)
 {
     _apiServices = apiServices;
     _apiCemetery = apiCemetery;
     _apiBurial   = apiBurial;
 }