Esempio n. 1
0
        /// <summary>
        /// 删除设备信息
        /// </summary>
        /// <returns></returns>
        public void DeleteDevice()
        {
            MessageBoxWindow mbw = new MessageBoxWindow();

            mbw.vm_MessageBoxWindow = new AMS.ViewModel.ViewModelMessageBoxWindow(AMS.Model.Enum.MessageBoxType.Warning, "确定删除该设备信息吗?");
            mbw.ShowDialog();
            if (mbw.vm_MessageBoxWindow.Result)
            {
                if (ViewModelDevice.ButtonSubmit(0))
                {
                    mbw = new MessageBoxWindow();
                    mbw.vm_MessageBoxWindow = new AMS.ViewModel.ViewModelMessageBoxWindow(AMS.Model.Enum.MessageBoxType.Success, "删除成功");
                    mbw.ShowDialog();
                }
            }
            //ViewModelDevice.Cmd = AMS.ViewModel.Enum.HandleType.Delete;
            //MessageBoxResult r = MessageBox.Show("确定删除该设备信息吗?", "删除", MessageBoxButton.OKCancel);
            //if (r == MessageBoxResult.OK)
            //{
            //    IsSuccess =ViewModelDevice.ButtonSubmit();
            //    if (IsSuccess)
            //    {
            //        MessageBox.Show("删除成功。");
            //    }
            //}
        }
Esempio n. 2
0
        private void button4_Click(object sender, RoutedEventArgs e)
        {
            //获取设备类型
            int deviceType = -1;

            if ((bool)this.rbtnSeatDevice.IsChecked)
            {
                deviceType = 0;
            }
            if ((bool)this.rbtnSpaceDevice.IsChecked)
            {
                deviceType = 1;
            }
            if ((bool)this.rbtnLockerDevice.IsChecked)
            {
                deviceType = 2;
            }
            IsSuccess = ViewModelDevice.ButtonSubmit(deviceType);
            if (IsSuccess)
            {
                MessageBoxWindow mbw = new MessageBoxWindow();
                mbw.vm_MessageBoxWindow = new AMS.ViewModel.ViewModelMessageBoxWindow(AMS.Model.Enum.MessageBoxType.Success, "操作成功!");
                mbw.ShowDialog();
                this.Close();
            }
        }
 private void button4_Click(object sender, RoutedEventArgs e)
 {
     IsSuccess = ViewModelDevice.ButtonSubmit();
     if (IsSuccess)
     {
         MessageBoxWindow mbw = new MessageBoxWindow();
         mbw.vm_MessageBoxWindow = new AMS.ViewModel.ViewModelMessageBoxWindow(AMS.Model.Enum.MessageBoxType.Success, "操作成功!");
         mbw.ShowDialog();
         this.Close();
     }
 }