|
@@ -19,7 +19,7 @@ namespace CopyCenter
|
|
/// </summary>
|
|
/// </summary>
|
|
public partial class ServicesWindow : Window
|
|
public partial class ServicesWindow : Window
|
|
{
|
|
{
|
|
- gr672_liiEntities db = new gr672_liiEntities();
|
|
|
|
|
|
+ gr672_liiEntities db;
|
|
public ServicesWindow()
|
|
public ServicesWindow()
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
@@ -40,6 +40,8 @@ namespace CopyCenter
|
|
service.DescriptionService = Description.Text;
|
|
service.DescriptionService = Description.Text;
|
|
service.idCategory = Convert.ToInt32(idCategory.Text);
|
|
service.idCategory = Convert.ToInt32(idCategory.Text);
|
|
db.Service.Add(service);
|
|
db.Service.Add(service);
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ ServicesList.ItemsSource = db.Service.ToList();
|
|
}
|
|
}
|
|
|
|
|
|
private void Update(object sender, RoutedEventArgs e)
|
|
private void Update(object sender, RoutedEventArgs e)
|
|
@@ -49,6 +51,8 @@ namespace CopyCenter
|
|
uRow.PriceService = Convert.ToInt32(Price.Text);
|
|
uRow.PriceService = Convert.ToInt32(Price.Text);
|
|
uRow.DescriptionService = Description.Text;
|
|
uRow.DescriptionService = Description.Text;
|
|
uRow.idCategory = Convert.ToInt32(idCategory.Text);
|
|
uRow.idCategory = Convert.ToInt32(idCategory.Text);
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ ServicesList.ItemsSource = db.Service.ToList();
|
|
}
|
|
}
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|