Ejemplo n.º 1
0
        public Browser(Cook cookAccount, MainWindow mw_in)
        {
            InitializeComponent();
            c  = cookAccount;
            mw = mw_in;

            Random r = new Random();

            for (int i = 0; i < 10; i++)
            {
                //generate eaters of random distance
                eaters.Add(new Eater(names[i], 100 + i, 100 * Math.Round(r.NextDouble(), 5)));
                comboBox.Items.Add(eaters[i].Name);
            }
        }
Ejemplo n.º 2
0
 public Rate(Cook c_in)
 {
     InitializeComponent();
     c = c_in;
 }
Ejemplo n.º 3
0
 public Account(Cook c_in)
 {
     InitializeComponent();
     c = c_in;
 }
Ejemplo n.º 4
0
        public CookerHub(Cook cookAccount, MainWindow mw_in, Eater m)
        {
            InitializeComponent();
            c     = cookAccount;
            mw    = mw_in;
            match = m;


            //simulate eater accepting
            MessageBox.Show("The User has accepted your match request.\nYOu are now matched with " + match + ".");
            //show who is matched
            label2.Content += match.Name;


            //if hygiene test expires at a date later than current date PVG is true
            if (DateTime.Compare(c.H_Date, DateTime.Now.Date) >= 0)
            {
                c.HygieneCert = "OK";
            }
            else
            {
                c.HygieneCert = "EXPIRED";
            }


            //Print current approval status and activate or deactivate button to find a match
            if (c.HygieneCert == "OK" && c.Pvg == "OK")
            {
                c.CookApproved        = true;
                statusLabel.Content  += "APPROVED";
                matchButton.IsEnabled = true;
            }
            else
            {
                c.CookApproved        = false;
                statusLabel.Content  += "NOT APPROVED";
                matchButton.IsEnabled = false;
            }

            if (c.HygieneCert == "OK")
            {
                statusLabel.Content += "\nHygiene Certified: Yes\nExpires on: " + c.H_Date.ToString("yyyy-MM-dd");
            }
            else
            {
                statusLabel.Content += "\nHygiene Certified: No";
            }

            if (c.Pvg == "OK")
            {
                statusLabel.Content += "\nPVG OK";
            }
            else if (c.Pvg == "AWAITING RESULT")
            {
                statusLabel.Content += "\nPVG AWAITING APPROVAL";
            }
            else
            {
                statusLabel.Content += "\nPVG REJECTED";
            }
        }