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.Shapes;
using Database.Repository;

namespace Pos.Setting.Product
{
    /// <summary>
    /// Interaction logic for ArchiveProductWindow.xaml
    /// </summary>
    public partial class ArchiveProductWindow : Window
    {
        private int _productId;
        public ArchiveProductWindow(int productId)
        {
            InitializeComponent();
            _productId = productId;
            ProductRepository productRepository = new ProductRepository();
            Database.Models.ProductEntity product = productRepository.GetById(_productId);
            txtDelProduct.Text = product.Name;
        }

        private void btnYes_Click(object sender, RoutedEventArgs e)
        {
            ProductRepository productRepository = new ProductRepository();
            productRepository.Archive(_productId);
            this.Close();
        }

        private void btnNo_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
