예제 #1
0
 /// <summary>
 /// Author: Jared Greenfield
 /// Created On: 03/28/2019
 /// Construtcts the window to do it's crud function
 /// </summary>
 public frmOffering(DataObjects.CrudFunction type, Offering offering, Employee employee)
 {
     InitializeComponent();
     _offering        = offering;
     _offeringManager = new OfferingManager();
     _employee        = employee;
     _eventManager    = new LogicLayer.EventManager();
     try
     {
         List <string> types = _offeringManager.RetrieveAllOfferingTypes();
         cboOfferingType.Items.Clear();
         foreach (var item in types)
         {
             cboOfferingType.Items.Add(item);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Unable to load Offering Types.");
     }
     if (type == CrudFunction.Retrieve)
     {
         setupReadOnly();
     }
 }
        /// <summary>
        /// This is the constructor for create
        /// </summary>
        public SetupDetail()
        {
            InitializeComponent();

            _setupManager = new SetupManager();
            _eventManager = new LogicLayer.EventManager();

            try
            {
                _events = _eventManager.RetrieveAllEvents();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            // The combobox for all of the event names for the user to choose from
            //cboEventName.ItemsSource = _events;
            // Jared Addition
            cboEventName.Items.Clear();
            if (_events != null)
            {
                foreach (var item in _events)
                {
                    cboEventName.Items.Add(item.EventTitle);
                }
            }


            dtpDateEntered.IsEnabled = false;
            btnSetupList.Visibility  = Visibility.Hidden;

            dtpDateEntered.SelectedDate = DateTime.Now;
        }
        /// <summary>
        /// Author: Caitlin Abelson
        /// Created Date: 3/5/19
        ///
        /// The constructor for creating a SetupList
        /// </summary>
        public SetupListDetail(Setup setup, string eventName)
        {
            InitializeComponent();

            _setupListManager = new SetupListManager();
            _setupManager     = new SetupManager();
            _eventManager     = new LogicLayer.EventManager();
            _setup            = setup;
            _vmSetupList      = new List <VMSetupList>();
            _eventName        = eventName;

            txtEventName.Text = eventName;
        }
        /// <summary>
        /// Author: Caitlin Abelson
        /// Created Date: 3/5/19
        ///
        /// The constructor for updating a SetupList
        /// </summary>
        public SetupListDetail(SetupList setupList, string eventName)
        {
            InitializeComponent();

            _setupListManager = new SetupListManager();
            _setupManager     = new SetupManager();
            _eventManager     = new LogicLayer.EventManager();


            _oldSetupList = setupList;
            _eventName    = eventName;

            txtEventName.Text = eventName;

            readOnlyForm();
        }