Не работает добавление даты в DataGrid. что делать?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml.Linq;
namespace ZooShop.Pages
{
///
/// Логика взаимодействия для AddTovariPage.xaml
///
public partial class AddTovariPage : Page
{
private readonly EquipmentRepairs _currentEquipmentRepairs = new EquipmentRepairs();
public AddTovariPage(EquipmentRepairs selectEquipmentRepairs)
{
InitializeComponent();
_currentEquipmentRepairs.Equipment = string.Empty;
_currentEquipmentRepairs.IssueType = string.Empty;
_currentEquipmentRepairs.IssueDescription = string.Empty;
_currentEquipmentRepairs.Status = string.Empty;
_currentEquipmentRepairs.AddedDate = null;
if (string.IsNullOrWhiteSpace(_currentEquipmentRepairs.Equipment))
errors.AppendLine("Укажите название обарудование");
if (string.IsNullOrWhiteSpace(_currentEquipmentRepairs.IssueType))
errors.AppendLine("укажите тип проблемы");
if (string.IsNullOrWhiteSpace(_currentEquipmentRepairs.IssueDescription))
errors.AppendLine("укажите описание");
if (string.IsNullOrWhiteSpace(_currentEquipmentRepairs.Client))
errors.AppendLine("укажите клиента");
if (string.IsNullOrWhiteSpace(_currentEquipmentRepairs.Status))
errors.AppendLine("укажите статус");
if (_currentEquipmentRepairs.AddedDate == null)
errors.AppendLine("укажите дату");
if (errors.Length > 0)
{
MessageBox.Show(errors.ToString());
return;
}
if (DataContext is EquipmentRepairs dataEquipmentRepairs)
{
if (dataEquipmentRepairs.RepairID == 0)
{
TechnoserviceEntities.GetContext.EquipmentRepairs.Add(dataEquipmentRepairs);
}