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;
namespace Gas_Station.Pages
{
/// <summary>
/// Логика взаимодействия для CustomersPage.xaml
/// </summary>
public partial class CustomersPage : Page
{
public CustomersPage()
{
InitializeComponent();
CustomersGrid.ItemsSource = GSDB.Connection.Customers.ToList();
}
private void DeleteButton_Click(object sender, RoutedEventArgs e)
{
var b = CustomersGrid.SelectedItem as Customers;
GSDB.Connection.Customers.Remove(b);
CustomersGrid.ItemsSource = GSDB.Connection.Customers.ToList();
}
private void EditButton_Click(object sender, RoutedEventArgs e)
{
var b = CustomersGrid.SelectedItem as Customers;
NavigationService.Navigate(new AddCustomersPage(b));
}
}
}
Отсутствует аргумент, соответствующий требуемому параметру "_customers из AddCustomersPage.AddCustomersPage(Customers)
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;
namespace Gas_Station.Pages
{
/// <summary>
/// Логика взаимодействия для AddCustomersPage.xaml
/// </summary>
public partial class AddCustomersPage : Page
{
public AddCustomersPage( Customers _customers)
{
InitializeComponent();
MyCustomers = _customers;
DataContext = this;
}
public Customers MyCustomers { get; set; }
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
if (
MyCustomers.ID _Customers == 0)
{
GSDB.Connection.Customers.Add(MyCustomers);
}
GSDB.Connection.SaveChanges();
NavigationService.Navigate(new CustomersPage());
}
}
}
У меня вот такая ошибка, уже сколько времени ломаю голову не могу ее решить, попытался решить через помощника в visual studio но прибавилось еще одна ошибка, теперь и одна из таблиц базы данных недоступна.