public MainWindow()
 {
     InitializeComponent();
     ////creating file reader object and using it's method to read the Database and for file operations
     dbAccess = SingletonDatabaseAccess.DBInstance;
     ////reading our database and filling in the data to operate on
     dbAccess.readDB_OnStartup();
 }
 public NewUserWindow()
 {
     InitializeComponent();
     createAdmin.Visibility = Visibility.Hidden;
     createCook.Visibility  = Visibility.Hidden;
     createEater.Visibility = Visibility.Hidden;
     ////creating file reader object and using it's method to read the Database and for file operations
     dbAccess = SingletonDatabaseAccess.DBInstance;
 }
 public CompleteMeal(Cook cook, Eater eater)
 {
     InitializeComponent();
     dbAccess                  = SingletonDatabaseAccess.DBInstance;
     this.currentCook          = cook;
     this.currentEater         = eater;
     this.lblCookName.Content  = currentCook.Name;
     this.lblEaterName.Content = currentEater.Name;
     this.lblEaterCity.Content = currentEater.City;
 }
Пример #4
0
        public AdminWindow(Administrator admin)
        {
            InitializeComponent();
            currentAdministrator = admin;
            dbAccess             = SingletonDatabaseAccess.DBInstance;

            foreach (Cook cook in dbAccess.CooksDB)
            {
                lstAvailableCooks.Items.Add("Name: " + cook.Name + ", Valid PVG: " + cook.ValidHygieneCertificate + ", Valid Hygiene Certificate: " + cook.ValidHygieneCertificate);
            }
        }
        public CookWindow(Cook cook)
        {
            InitializeComponent();
            this.currentCook = cook;
            dbAccess         = SingletonDatabaseAccess.DBInstance;

            lblCookActiveSince.Content = currentCook.ActiveSince.ToShortDateString();
            lblCookName.Content        = currentCook.Name;
            lblCookCity.Content        = currentCook.City;

            if (currentCook.ValidPVG == Cook.pvg_hygiene_statuses.OK)
            {
                lblPVGstatusOK.Visibility = Visibility.Visible;
                readMeals();
            }
            else if (currentCook.ValidPVG == Cook.pvg_hygiene_statuses.AwaitingResults)
            {
                lblPVGstatusAwaiting.Visibility = Visibility.Visible;
                disableButtons();
            }
            else
            {
                lblPVGstatusBAD.Visibility = Visibility.Visible;
                disableButtons();
            }

            if (currentCook.ValidHygieneCertificate == Cook.pvg_hygiene_statuses.OK)
            {
                lblHygieneStatusOK.Visibility = Visibility.Visible;
                readMeals();
            }
            else if (currentCook.ValidHygieneCertificate == Cook.pvg_hygiene_statuses.RenevalWith3months)
            {
                lblHygieneStatusRenew.Visibility = Visibility.Visible;
                lblHygieneTitle.Visibility       = Visibility.Visible;
                lblCookRenewalDate.Visibility    = Visibility.Visible;
                lblCookRenewalDate.Content       = currentCook.HygieneRenevalDate.ToShortDateString();
                readMeals();
            }
            else
            {
                lblHygieneStatusBAD.Visibility = Visibility.Visible;
                lblHygieneTitle.Visibility     = Visibility.Visible;
                lblHygieneOverdue.Visibility   = Visibility.Visible;
                disableButtons();
            }
        }
        public SendMealOffer(Cook cook, Eater eater)
        {
            InitializeComponent();
            dbAccess          = SingletonDatabaseAccess.DBInstance;
            this.currentCook  = cook;
            this.currentEater = eater;
            //filling in the combobox with available times
            for (int i = 12; i < 20; i++)
            {
                cmbSetTime.Items.Add(i + ":00");
                cmbSetTime.Items.Add(i + ":30");
            }

            this.lblCookName.Content  = currentCook.Name;
            this.lblEaterName.Content = currentEater.Name;
            this.lblEaterCity.Content = currentEater.City;
            currentMealOffer          = new Meal();
        }
        //bool mealPhotoUploaded = false;

        public SendMealOffer()
        {
            InitializeComponent();
            dbAccess = SingletonDatabaseAccess.DBInstance;
        }