using Microsoft.Data.SqlClient;
using Shop.Context;
using Shop.Entites;
using System.Data;

namespace Shop
{
    public partial class Shop : Form
    {
        public ShopContext Context;
        public Shop(ShopContext context)
        {
            InitializeComponent();
            Context = context;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            //  AddUsers();
        
        }

        void AddUsers()
        {
            var user1 = new User()
            {
                Name = "saeeed",
                Email = "saeed@yahoo.com",
                Phone = "0936000000"
            };
            Context.Users.Add(user1);
            var user2 = new User()
            {
                Name = "reza",
                Email = "reza@yahoo.com",
                Phone = "0936000000"
            };
            Context.Users.Add(user2);

            var user3 = new User()
            {
                Name = "ali",
                Email = "ali@yahoo.com",
                Phone = "0936000000"
            };
            Context.Users.Add(user3);
            Context.SaveChanges();

        }


        private void BtnExit_Click(object sender, EventArgs e)
        {
         
        }

        private void BtnOrders_Click(object sender, EventArgs e)
        {
         
        }

        private void BtnReports_Click(object sender, EventArgs e)
        {
        

        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            AddOrder addOrder = new AddOrder(new ShopContext());
            addOrder.ShowDialog();
        }

        private void BtnProduct_Click(object sender, EventArgs e)
        {
        
        }
    }
}