public override void Activate()
        {
            Task.Factory.StartNew(() =>
            {
                Task.Delay(5000).Wait();
                FormMain.Form.Open <ControllerScanRFID>();
            });
            InteractiveMap map = View.InteractiveMap;

            map.ImageMap    = Image.FromFile("location1.png");
            map.MouseClick += (sender, e) => { MessageBox.Show(string.Format("X: {0}, Y: {1}", e.X, e.Y)); };
            var visitor       = Values.SafeGetValue <Visitor>("visitor");
            int reservationID = visitor.ReservationId;


            IEnumerable <ReservationSpot> reservation =
                ReservationSpot.Select("RESERVATIONID = " + reservationID.ToSqlFormat());
            double x = reservation.FirstOrDefault().Spot.LocX;
            double y = reservation.FirstOrDefault().Spot.LocY;

            map.Add(x, y);
        }
    private void LoadProjectFromPath()
    {
        try
        {
            SimpleZipper zipper = new SimpleZipper();
            byte[]       data   = File.ReadAllBytes(settings.MapFilePath);
            zipper.Unzip(data, settings.StaticPath);

            string dataJson = File.ReadAllText(settings.StaticDataPath);
            interactiveMap = JsonUtility.FromJson <InteractiveMap>(dataJson);
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
            Action <MessageResult> onComplete = (MessageResult result) =>
            {
                Editor.GoToMainMenu();
            };

            MessageBox.ShowMessage(MessageType.OK, onComplete, OnLoadErrorMessage, OnLoadErrorCaption);
        }
    }
Example #3
0
        public void LoadForm(string FormName)
        {
            this.Text = "Marathon Skills 2015";

            logout = true;
            panel2.Controls.Clear();
            if (FormName == "SPONSORARUNNER")
            {
                SponsoraRunner sr = new SponsoraRunner();
                sr.Dock = DockStyle.Fill;
                panel2.Controls.Add(sr);
                back       = "";
                logout     = false;
                this.Text += " - Sponsor a Runner";
            }
            else if (FormName == "SPONSORSHIPCONFIRMATION")
            {
                SponsorshipConfirmation sc = new SponsorshipConfirmation();
                sc.Dock = DockStyle.Fill;
                panel2.Controls.Add(sc);
                back       = "";
                logout     = false;
                this.Text += " - Sponsorship Confirmation";
            }
            else if (FormName == "FINDOUTMOREINFORMATION")
            {
                FindoutmoreInformation fo = new FindoutmoreInformation();
                panel2.Controls.Add(fo);
                back       = "";
                logout     = false;
                this.Text += " - Find Out more Information";
            }
            else if (FormName == "LISTOFCHARITIES")
            {
                ListofCharities lc = new ListofCharities();
                panel2.Controls.Add(lc);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - List of Charities";
            }
            else if (FormName == "LOGIN")
            {
                LoginForm lf = new LoginForm();
                panel2.Controls.Add(lf);
                back       = "";
                logout     = false;
                this.Text += " - Login";
            }
            else if (FormName == "RUNNERMENU")
            {
                RunnerMenu rm = new RunnerMenu();
                panel2.Controls.Add(rm);
                back       = "";
                logout     = true;
                this.Text += " - Runner Menu";
            }
            else if (FormName == "COORDINATORMENU")
            {
                CoordinatorMenu cm = new CoordinatorMenu();
                panel2.Controls.Add(cm);
                back       = "";
                logout     = true;
                this.Text += " - Coordinator Menu";
            }
            else if (FormName == "ADMINISTRATORMENU")
            {
                AdministratorMenu am = new AdministratorMenu();
                panel2.Controls.Add(am);
                back       = "";
                logout     = true;
                this.Text += " - Administrator Menu";
            }
            else if (FormName == "CHECKIFRUNNERHASCOMPETEDBEFORE")
            {
                CheckIfRunnerhasCompetedBefore ch = new CheckIfRunnerhasCompetedBefore();
                panel2.Controls.Add(ch);
                back       = "";
                logout     = false;
                this.Text += " - Register as a runner";
            }
            else if (FormName == "REGISTERASARUNNER")
            {
                RunnerRegistration rr = new RunnerRegistration();
                panel2.Controls.Add(rr);
                back       = "";
                logout     = false;
                this.Text += " - Register as a runner";
            }
            else if (FormName == "REGISTERFORANEVENT")
            {
                RegisterForAnEvent re = new RegisterForAnEvent();
                panel2.Controls.Add(re);
                back       = "RUNNERMENU";
                logout     = true;
                this.Text += " - Register for an event";
            }
            else if (FormName == "REGISTRATIONCONFIRMATION")
            {
                RegistrationConfirmation rc = new RegistrationConfirmation();
                panel2.Controls.Add(rc);
                back       = "RUNNERMENU";
                logout     = true;
                this.Text += " - Registration Confirmation";
            }
            else if (FormName == "EDITYOURPROFILE")
            {
                EditProfile ep = new EditProfile();
                panel2.Controls.Add(ep);
                back       = "RUNNERMENU";
                logout     = true;
                this.Text += " - Edit runner profile";
            }
            else if (FormName == "MYRACERESULTS")
            {
                MyRaceResult mr = new MyRaceResult();
                panel2.Controls.Add(mr);
                back       = "RUNNERMENU";
                logout     = true;
                this.Text += " - My race results";
            }
            else if (FormName == "HOWLONGISAMARATHON")
            {
                HowlongisaMarathon hl = new HowlongisaMarathon();
                panel2.Controls.Add(hl);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - How long is a marathon";
            }
            else if (FormName == "ABOUTMARATHON")
            {
                AboutMarathonSkills am = new AboutMarathonSkills();
                panel2.Controls.Add(am);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - About Marathon Skills 2015";
            }
            else if (FormName == "INTERACTIVEMAP")
            {
                InteractiveMap im = new InteractiveMap();
                panel2.Controls.Add(im);
                back       = "ABOUTMARATHON";
                logout     = false;
                this.Text += " - Interactive Map";
            }
            else if (FormName == "PREVIOUSRACERESULTS")
            {
                PreviousRaceResults pr = new PreviousRaceResults();
                panel2.Controls.Add(pr);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - Previous race results";
            }
            else if (FormName == "MYSPONSORSHIP")
            {
                mySponsorship ms = new mySponsorship();
                panel2.Controls.Add(ms);
                back       = "RUNNERMENU";
                logout     = true;
                this.Text += " -  My sponsorship";
            }
            else if (FormName == "RUNNERMANAGEMENT")
            {
                RunnerManagement rm = new RunnerManagement();
                panel2.Controls.Add(rm);
                back       = "COORDINATORMENU";
                logout     = true;
                this.Text += " -  Runner management";
            }
            else if (FormName == "MANAGEARUNNER")
            {
                ManageaRunner mr = new ManageaRunner();
                panel2.Controls.Add(mr);
                back       = "RUNNERMANAGEMENT";
                logout     = true;
                this.Text += " - Manage a runner";
            }
            else if (FormName == "EDITPROFILE")
            {
                EditRunnerProfile er = new EditRunnerProfile();
                panel2.Controls.Add(er);
                back       = "MANAGEARUNNER";
                logout     = true;
                this.Text += " - Edit runner profile";
            }
            else if (FormName == "CERTIFICATEPREVIEW")
            {
                CertificatePreview cp = new CertificatePreview();
                panel2.Controls.Add(cp);
                back       = "MANAGEARUNNER";
                logout     = true;
                this.Text += " - Certificate Preview";
            }
            else if (FormName == "SPONSORSHIPOVERVIEW")
            {
                SponsorshipOverview so = new SponsorshipOverview();
                panel2.Controls.Add(so);
                back       = "COORDINATORMENU";
                logout     = true;
                this.Text += " - Sponsorship Overview";
            }
            else if (FormName == "USERMANAGEMENT")
            {
                UserManagement um = new UserManagement();
                panel2.Controls.Add(um);
                back       = "ADMINISTRATORMENU";
                logout     = true;
                this.Text += " - User Management";
            }
            else if (FormName == "EDITAUSER")
            {
                Editauser eu = new Editauser();
                panel2.Controls.Add(eu);
                back       = "USERMANAGEMENT";
                logout     = true;
                this.Text += " - Edit a User";
            }
            else if (FormName == "ADDNEWUSER")
            {
                AddanewUser au = new AddanewUser();
                panel2.Controls.Add(au);
                back       = "USERMANAGEMENT";
                logout     = true;
                this.Text += " - Add a new user";
            }
            else if (FormName == "MANAGECHARITIES")
            {
                ManageCharities mc = new ManageCharities();
                panel2.Controls.Add(mc);
                back       = "ADMINISTRATORMENU";
                logout     = false;
                this.Text += " - Manage Charities";
            }
            else if (FormName == "ADDEDITCHARITY")
            {
                AddEditCharity ae = new AddEditCharity();
                panel2.Controls.Add(ae);
                back   = "MANAGECHARITIES";
                logout = true;
            }
            else if (FormName == "VOLUNTEERSMANAGEMENT")
            {
                VolunteerManagement vm = new VolunteerManagement();
                panel2.Controls.Add(vm);
                back       = "ADMINISTRATORMENU";
                logout     = true;
                this.Text += " - Volunteers Management";
            }
            else if (FormName == "IMPORTVOLUNTEERS")
            {
                ImportVolunteers iv = new ImportVolunteers();
                panel2.Controls.Add(iv);
                back       = "VOLUNTEERSMANAGEMENT";
                logout     = true;
                this.Text += " - Import Voluteers";
            }
            else if (FormName == "BMICALCULATOR")
            {
                BMICalculator bmi = new BMICalculator();
                panel2.Controls.Add(bmi);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - BMI Calculator";
            }
            else if (FormName == "BMRCALCULATOR")
            {
                BMRCalculator bmr = new BMRCalculator();
                panel2.Controls.Add(bmr);
                back       = "FINDOUTMOREINFORMATION";
                logout     = false;
                this.Text += " - BMR Calculator";
            }
            //end
            btnLogout.Visible = logout;
        }
Example #4
0
        private void ShowMapBrowser(double lat, double lon)
        {
            // This requires a registry fix. (IE emulation)

            browser.DocumentText = InteractiveMap.GetHtml(lat, lon, browser.Width, browser.Height);
        }
 private void CreateNewProject()
 {
     interactiveMap = new InteractiveMap(settings.Name);
     File.Copy(settings.ImagePath, settings.StaticImagePath, true);
 }
Example #6
0
 public void Set(InteractiveMap interactiveMap)
 {
     this.interactiveMap = interactiveMap;
     SpawnMapItems();
 }