private void button_Admin_OK_Click(object sender, EventArgs e)
        {
            using (var contecxt = new Entities())
            {
                var usr = contecxt.Users;

                foreach (var u in usr)
                {
                    if (textBox_adminName.Text == u.First_Name && textBox_adminPassword.Text == u.Password)
                    {
                       ClassLibrary1.CloseForm.getInstance().Form= "true"  ;
                        ClassLibrary1.Users.getInstance().Number = textBox_adminName.Text;
                        ClassLibrary1.ClassUserform.getInstance().GuID = u.UserID;
                        ClassLibrary1.ClassUserform.getInstance().Pass = u.Password;
                        ClassLibrary1.ClassUserform.getInstance().Username = u.First_Name;
                        ClassLibrary1.ClassUserform.getInstance().Lastname = u.Last_Name;
                        MessageBox.Show(String.Format("Добре дошъл {0}", textBox_adminName.Text));
                        this.Dispose();
                        break;
                    }
                    else
                    {

                        ClassLibrary1.CloseForm.getInstance().Form = "false";

                    }
                }
                if (ClassLibrary1.CloseForm.getInstance().Form == "false")
                {
                    MessageBox.Show(String.Format("Съжаляваме но имате допуснати грешки при - Не съществуващ потребител {0}", textBox_adminName.Text));
                }
            }
        }
        private void button_Add_Click(object sender, EventArgs e)
        {
            string name = textBox1_Ime.Text;
            string lastname = textBox2_Familia.Text;
            string pass = textBox_Password.Text;
            User newUser = new User();
            newUser.First_Name = name;
            newUser.Last_Name = lastname;
            newUser.Password = pass;

            using (var context = new Entities())
            {

                var user1 = new User()
                {
                    First_Name = name,
                    Last_Name = lastname,
                    Password = pass,
                    UserID=Guid.NewGuid()

                };
                context.AddToUsers(user1);
                context.SaveChanges();
                dataGridView1.DataSource = context.Users;
            }
        }
        private void button_Delete_Click(object sender, EventArgs e)
        {
            int row = dataGridView1.CurrentCell.RowIndex;

            string del = string.Format("{0}", dataGridView1[row, 0].Value);

            using (var context = new Entities())
            {
                var wuery = (from data in context.Users
                             where data.First_Name==del
                             select data).First();
                context.Attach(wuery);
                context.DeleteObject(wuery);
                context.SaveChanges();
                dataGridView1.DataSource = context.Users;
            }
        }
 private void Add_User_Load(object sender, EventArgs e)
 {
     Entities context = new Entities();
     dataGridView1.DataSource = context.Users;
 }