Dem_Timofeev_itog/DEM_Timofeev_prob/Form_user.cs

63 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DEM_Timofeev_prob.Models;
using Microsoft.EntityFrameworkCore;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace DEM_Timofeev_prob
{
public partial class Form_user : Form
{
DemDemContext context;
public Form_user()
{
InitializeComponent();
dataGridView1.DataError += (sender, e) => e.ThrowException = false;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
context = new DemDemContext();
context.Products.Include(x => x.IdTipeProductNavigation).Include(x => x.IdManufacturNavigation).Include(x => x.IdSuplierNavigation).Include(x => x.IdEdNavigation).Load();
context.Database.EnsureCreated();
bindingSource_product.DataSource = context.Products.Local.ToBindingList();
bindingSource_manufactur.DataSource = context.Manufacts.Local.ToBindingList();
bindingSource_ed.DataSource = context.Eds.Local.ToBindingList();
bindingSource_supplier.DataSource = context.Supliers.Local.ToBindingList();
bindingSource_tipe_product.DataSource = context.TipeProducts.Local.ToBindingList();
}
private void button3_Click(object sender, EventArgs e)
{
this.Hide();
Form1 ff = new Form1();
ff.Show();
}
public void user(string fio)
{
label3.Text = fio;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}