コード例 #1
0
 private void Update(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(_currentClassification.Description))
     {
         MessageWindow.ShowAlertMessage("Classification Name must not be empty!");
         return;
     }
     if (_currentClassification.ClassificationId == 0)
     {
         _currentClassification.Create();
         return;
     }
     _currentClassification.Update();
 }
コード例 #2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var item = Classification.FindByName(_newItem.Description);

            if (item == null)
            {
                var result = _newItem.Create();
                if (result.Success)
                {
                    DialogResult = true;
                    Close();
                }
                else
                {
                    MessageWindow.ShowAlertMessage(result.Message);
                }
            }
            else
            {
                MessageWindow.ShowNotifyMessage("Classification already exists!");
            }
        }