Esempio n. 1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            int checkcount = STTemplateItemsSource.Count(r => r.IsChecked == true);

            if (checkcount == 0)
            {
                MessageBox.Show("请勾选需要删除的模板", "消息提示", MessageBoxButton.OK);
                return;
            }
            if (MessageBox.Show("确定删除已勾选的模板吗?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                try
                {
                    List <string> guids = STTemplateItemsSource.Where(o => o.IsChecked == true).Select(r => r.GUID).ToList();
                    BeOperationInvoker.Invoke <I_CO_IA_ActivitySummarize>(channel =>
                    {
                        if (channel.DeleteSummarizeTemplate(guids))
                        {
                            //GetExamPlace();
                            STTemplateItemsSource = GetSTTemplate();
                            MessageBox.Show("删除成功!", "提示", MessageBoxButton.OK);
                        }
                        else
                        {
                            MessageBox.Show("删除失败!", "提示", MessageBoxButton.OK);
                        }
                    });
                }
                catch (Exception ex)
                {
                    MessageBox.Show("删除失败!原因:" + ex.Message.ToString(), "提示", MessageBoxButton.OK);
                }
            }
        }
Esempio n. 2
0
 private void chkAll_Loaded(object sender, RoutedEventArgs e)
 {
     chkAll = sender as CheckBox;
     if (this.STTemplateItemsSource != null)
     {
         chkAll.IsChecked = STTemplateItemsSource.Any(item => item.IsChecked);
     }
 }
Esempio n. 3
0
 private void chkCell_Click(object sender, RoutedEventArgs e)
 {
     if (STTemplateItemsSource != null)
     {
         int checkcount = STTemplateItemsSource.Count(r => r.IsChecked == true);
         if (checkcount == STTemplateItemsSource.Length)
         {
             chkAll.IsChecked = true;
         }
         else if (checkcount == 0)
         {
             chkAll.IsChecked = false;
         }
         else
         {
             chkAll.IsChecked = null;
         }
     }
 }