Exemplo n.º 1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     context = new CompanyCRMContext();
     //bi.DataSource = context.productsItem.ToList();
     bi.DataSource            = context.Login.ToList();
     dataGridView1.DataSource = bi;
     dataGridView1.Refresh();
 }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            context = new CompanyCRMContext();
            var customers = new LoginUser {
                id = 1
            };

            context.Entry(customers).State = EntityState.Deleted;
            context.SaveChanges();
        }
Exemplo n.º 3
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     using (context = new CompanyCRMContext())
     {
         var customers = context.Set <LoginUser>();
         customers.Add(new LoginUser {
             user = "******", password = "******"
         });
         context.SaveChanges();
     }
 }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            context                  = new CompanyCRMContext();
            bi.DataSource            = context.Login.ToList();
            dataGridView1.Dock       = DockStyle.Fill;
            dataGridView1.DataSource = bi;
            dataGridView1.Refresh();

            var log = context.Login.ToList();

            foreach (var cust in log)
            {
                MessageBox.Show(cust.id + " " + cust.user + " " + cust.password);
            }
        }