|
@@ -8,6 +8,7 @@ using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
+using System.Windows;
|
|
using System.Windows.Input;
|
|
using System.Windows.Input;
|
|
|
|
|
|
namespace DemoExam.ViewModel
|
|
namespace DemoExam.ViewModel
|
|
@@ -17,7 +18,7 @@ namespace DemoExam.ViewModel
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
public Entities DataBase = new Entities();
|
|
public Entities DataBase = new Entities();
|
|
- private ObservableCollection<Agent> outPutList;
|
|
|
|
|
|
+ public ObservableCollection<Agent> outPutList;
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<Agent> GetListAgent
|
|
public ObservableCollection<Agent> GetListAgent
|
|
@@ -123,7 +124,15 @@ namespace DemoExam.ViewModel
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- outPutList = new ObservableCollection<Agent>(outPutList.Where(x => x.AgentType.Title == filtString));
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ outPutList = new ObservableCollection<Agent>(outPutList.Where(x => x.AgentType.Title == filtString));
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show("Произшла ошибка. Перезапустите приложение для корректной работы");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -241,6 +250,10 @@ namespace DemoExam.ViewModel
|
|
{
|
|
{
|
|
if (selectedAgentType == "")
|
|
if (selectedAgentType == "")
|
|
{
|
|
{
|
|
|
|
+ if (SelectedAgent.AgentType == null)
|
|
|
|
+ {
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
return SelectedAgent.AgentType.Title.ToString();
|
|
return SelectedAgent.AgentType.Title.ToString();
|
|
}
|
|
}
|
|
return selectedAgentType;
|
|
return selectedAgentType;
|