Example #1
0
 private void chkAll_Loaded(object sender, RoutedEventArgs e)
 {
     chkAll = sender as CheckBox;
     if (this.TaskStuffItemsSource != null)
     {
         chkAll.IsChecked = TaskStuffItemsSource.Any(item => item.IsChecked);
     }
 }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (TaskStuffItemsSource == null)
            {
                MessageBox.Show("请选择需要导入的任务图片", "消息提示", MessageBoxButton.OK);
                return;
            }
            int checkcount = TaskStuffItemsSource.Count(r => r.IsChecked == true);

            if (checkcount == 0)
            {
                MessageBox.Show("请选择需要导入的任务图片", "消息提示", MessageBoxButton.OK);
                return;
            }
            List <GuaranteeProcess> listGp = new List <GuaranteeProcess>();

            for (int i = 0; i < TaskStuffItemsSource.Count(); i++)
            {
                if (TaskStuffItemsSource[i].IsChecked)
                {
                    GuaranteeProcess tempGp = new GuaranteeProcess();
                    //tempGp.GUID = Utility.NewGuid();
                    var taskStuff = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.MonitorTask.I_CO_IA_MonitorTask, CO_IA.Data.TaskStuff>(channel =>
                    {
                        return(channel.GetTaskStuffContent(TaskStuffItemsSource[i].Key));
                    });
                    tempGp.GUID          = TaskStuffItemsSource[i].Key;
                    tempGp.PHOTO         = taskStuff.Content;
                    tempGp.NAME          = TaskStuffItemsSource[i].Name;
                    tempGp.ACTIVITY_GUID = gp.ACTIVITY_GUID;
                    tempGp.TYPE          = gp.TYPE;
                    listGp.Add(tempGp);
                }
            }
            PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.ActivitySummarize.I_CO_IA_ActivitySummarize>(
                channel =>
            {
                channel.SaveGuaranteeProcessList(listGp);
                MessageBox.Show("导入成功", "提示", MessageBoxButton.OK);
                if (RefreshListEvent != null)
                {
                    RefreshListEvent();
                }
                this.Close();
            });
        }
Example #3
0
 private void chkCell_Click(object sender, RoutedEventArgs e)
 {
     if (TaskStuffItemsSource != null)
     {
         int checkcount = TaskStuffItemsSource.Count(r => r.IsChecked == true);
         if (checkcount == TaskStuffItemsSource.Length)
         {
             chkAll.IsChecked = true;
         }
         else if (checkcount == 0)
         {
             chkAll.IsChecked = false;
         }
         else
         {
             chkAll.IsChecked = null;
         }
     }
 }