Example #1
0
        private void Container_Edit_Click(object sender, RoutedEventArgs e)
        {
            if (Settings.ContainerOpen)
            {
                ContainerEdit containerEdit = new ContainerEdit();
                containerEdit.Owner = this; // for centering in parent window

                try
                {
                    containerEdit.ShowDialog();
                }
                catch (Exception ex)
                {
                    containerEdit.Close();
                    MessageBox.Show(string.Format("Error modifying key container - {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    ContainerClose();
                    return;
                }

                UpdateContainerText();

                if (!Settings.ContainerSaved && Settings.ScreenCurrent == "NavigateP25MultipleKeyload")
                {
                    SwitchScreen(Settings.ScreenCurrent, true);
                    MessageBox.Show("Multiple keyload selections reset due to key container edit", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
            else
            {
                MessageBox.Show("No container open", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #2
0
 private string CheckFields()
 {
     if (!ContainerEdit.IsOnlyOneContainerId(dbContext, Row.ContainerId))
     {
         return($"ContainerId {Messages.NotUnique}");
     }
     if (Row.Text is null && Row.Link is null && Row.Description is null)
     {
         return(fieldIsEmpty);
     }
     return(null);
 }
Example #3
0
        public JsonResult UpdateContainer(string text, int blockId, int priority, int containerId, bool isDelete = false)
        {
            var containerEdit = new ContainerEdit(new Container()
            {
                BlockId     = blockId,
                Text        = text,
                Priority    = priority,
                ContainerId = containerId,
            });

            var result = isDelete ? containerEdit.Delete() : containerEdit.Update();

            return(new JsonResult(result));
        }
        void ReleaseDesignerOutlets()
        {
            if (ContainerEdit != null)
            {
                ContainerEdit.Dispose();
                ContainerEdit = null;
            }

            if (ContainerShow != null)
            {
                ContainerShow.Dispose();
                ContainerShow = null;
            }

            if (deleteButton != null)
            {
                deleteButton.Dispose();
                deleteButton = null;
            }

            if (editButton != null)
            {
                editButton.Dispose();
                editButton = null;
            }

            if (persImageView != null)
            {
                persImageView.Dispose();
                persImageView = null;
            }

            if (persName != null)
            {
                persName.Dispose();
                persName = null;
            }
        }
Example #5
0
 void ShowCustomization()
 {
     SetupContainerEdit();
     ContainerEdit.ShowPopup();
 }