Пример #1
0
        public void ShowInitializer(string type, EventInitializer _temp, Event _eventData)
        {
            System.Windows.Forms.Form newForm = new System.Windows.Forms.Form();
            windowPosition = this.Location;

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

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

            case "employee":
                newForm = new EmployeeInitializer(_temp, _eventData);
                break;
            }
            this.Hide();
            newForm.Location = windowPosition;
            newForm.ShowDialog();
            if (!(this is EventInitializer)) // if the current open page is not an event viewer
            {
                this.Close();
            }
        }
Пример #2
0
 public EmployeeInitializer(EventInitializer _parentRef, Event _event)
 {
     parentRef = _parentRef;
     eventRef  = _event;
     InitializeComponent();
     UpdateListContents();
 }
Пример #3
0
 //copy constructor
 public StoreInitialize(EventInitializer _parentRef, Event _event)
 {
     parentRef = _parentRef;
     eventRef  = _event;
     InitializeComponent();
     UpdatePageContents();
     ResetLocalStore();
 }
Пример #4
0
 //used to return to the parent form
 protected void UnhideEventInitializer(EventInitializer _temp)
 {
     if (!_temp.Visible)
     {
         windowPosition = this.Location;
         this.Hide();
         _temp.Location = windowPosition;
         _temp.Show();
         _temp.UpdatePageContents();
         this.Close();
     }
 }
Пример #5
0
        //hides current window and opens event creation tool
        private void NewButton_Click(object sender, EventArgs e)
        {
            if (EventNameTextBox.TextLength != 0)
            {
                this.Hide();
                using (var eventViewer = new EventInitializer(EventNameTextBox.Text))
                {
                    switch (eventViewer.ShowDialog())
                    {
                    case DialogResult.OK:
                        UploadNewEvent(eventViewer.newEvent);
                        break;

                    case DialogResult.Cancel:
                        break;
                    }
                }
                this.Show();
            }
            else
            {
                ErrorLabel.Text = "ERROR: No event name given.";
            }
        }