Exemplo n.º 1
0
        //creates a new window when navigating child forms to the event viewer, on child is true if
        protected void ShowViewer(string type, EventViewer _temp, Event _eventData)
        {
            windowPosition = this.Location;
            System.Windows.Forms.Form newForm = new System.Windows.Forms.Form();

            switch (type.ToLower())
            {
            case "store":
                newForm = new StoreViewer(_temp, _eventData);
                break;

            case "item":
                newForm = new ItemViewer(_temp, _eventData);
                break;

            case "employee":
                newForm = new Form(_temp, _eventData);
                break;

            case "manager":
                newForm = new ManagerViewer(_temp, _eventData);
                break;
            }
            this.Hide();
            newForm.Location = windowPosition;
            newForm.ShowDialog();
            if (!(this is EventViewer)) // if the current open page is not an event viewer
            {
                this.Close();
            }
        }
Exemplo n.º 2
0
        //opens manager viewer using clicked manager as target
        private void ManagerNameTextBox_Click(object sender, EventArgs e)
        {
            windowPosition = this.Location;
            Store         foo     = storedEvent.GetStoreByManagerName(ManagerNameTextBox.Text);
            ManagerViewer newForm = new ManagerViewer(parentReference, storedEvent, foo.manager);

            this.Hide();
            newForm.Location = windowPosition;
            newForm.ShowDialog();
            this.Close();
        }
Exemplo n.º 3
0
 //click staff member off of list, opens staff viewer / manager viewer on using clicked staff member
 private void StaffMemberListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (StaffMemberListBox.SelectedIndex != -1)
     {
         windowPosition = this.Location;
         Staff foo = storedEvent.GetStaffByName(GetListBoxSelected(StaffMemberListBox));
         if (storedEvent.CheckIsManager(foo)) // staff member is manager
         {
             ManagerViewer tempForm = new ManagerViewer(parentReference, storedEvent, foo);
             this.Hide();
             tempForm.Location = windowPosition;
             tempForm.ShowDialog();
             this.Close();
         }
         else // staff member is not manager
         {
             Form newForm = new Form(parentReference, storedEvent, foo);
             this.Hide();
             newForm.Location = windowPosition;
             newForm.ShowDialog();
             this.Close();
         }
     }
 }