示例#1
0
 private void ConfirmExecute(object parameter)
 {
     if (string.IsNullOrWhiteSpace(Block.BlockName))
     {
         string        message       = "区域名称不能为空";
         string        detailMessage = "区域名称不允许为空";
         WarningWindow warn          = new WarningWindow(message, detailMessage);
         warn.ShowDialog();
     }
     else
     {
         AddBlockWindow AddBlockWindow = parameter as AddBlockWindow;
         bool           IsExist        = CallBack(Block);
         if (IsExist == true)
         {
             string        message       = "该层已存在相同名字的区域";
             string        detailMessage = "同一层中的区域名字不允许重复";
             WarningWindow warn          = new WarningWindow(message, detailMessage);
             warn.ShowDialog();
         }
         else
         {
             AddBlockWindow.Close();
         }
     }
 }
        public void AddBlockExecute(object parameter)
        {
            AddBlockWindow          addBlockWindow   = new AddBlockWindow();
            AddBlockWindowViewModel AddBlockWindowvm = addBlockWindow.DataContext as AddBlockWindowViewModel;

            AddBlockWindowvm.CallBack = new Func <Block, bool>(CallBack);
            addBlockWindow.Show();
        }
示例#3
0
        private void CancelExecute(object parameter)
        {
            Block = null;
            AddBlockWindow AddBlockWindow = parameter as AddBlockWindow;

            CallBack(Block);
            AddBlockWindow.Close();
        }
示例#4
0
        void update()
        {
            if (AddBlockWindow.validate_input(adminWindow, nameTextBox, trialCountTextBox, idTextBox, block) == false)
            {
                return;
            }

            AddBlockWindow.initialize(block, nameTextBox, idTextBox, sdGroupTextBox, descriptionTextBox, trialCountTextBox);

            flush();
            Close();
        }