示例#1
0
        /// <summary>
        /// Pat Banks
        /// Created: 2015/04/26
        ///
        /// Sends the eventType that user wants to edit to the BusinessLogic Layer
        /// Returns an indication of whether or not the transaction was successful
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnEditType_Click(object sender, RoutedEventArgs e)
        {
            if (!TxtEditEventType.Text.ValidateString())
            {
                ShowInputErrorMessage(TxtEditEventType, "Please enter a valid Event Type");
            }

            var oldEventType = (Common.EventType)CboEditEvent.SelectedItem;
            var newEventType = new Common.EventType(oldEventType.EventTypeID, TxtEditEventType.Text);

            _result = _eventManager.EditEventType(oldEventType, newEventType);

            if (_result.Equals(EventManager.EventResult.Success))
            {
                await ShowMessage("Your Request was Processed Successfully", "Success");

                CboEditEvent.SelectedIndex = -1;
                TxtEditEventType.Text      = "";
                FillComboBox();
            }
            else
            {
                await ShowMessage("Event type could not be updated.", "Error");
            }
        }
        /// <summary>
        /// Pat Banks
        /// Created: 2015/04/26
        ///
        /// Sends the eventType that user wants to edit to the BusinessLogic Layer
        /// Returns an indication of whether or not the transaction was successful
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnEditType_Click(object sender, RoutedEventArgs e)
        {
            if (!TxtEditEventType.Text.ValidateString())
            {
                ShowInputErrorMessage(TxtEditEventType, "Please enter a valid Event Type");
            }

            var oldEventType = (Common.EventType)CboEditEvent.SelectedItem;
            var newEventType = new Common.EventType(oldEventType.EventTypeID, TxtEditEventType.Text);

            _result = _eventManager.EditEventType(oldEventType, newEventType);

            if (_result.Equals(EventManager.EventResult.Success))
            {
                await ShowMessage("Your Request was Processed Successfully", "Success");
                CboEditEvent.SelectedIndex = -1;
                TxtEditEventType.Text = "";
                FillComboBox();
            }
            else
            {
                await ShowMessage("Event type could not be updated.", "Error");
            }
        }