private void btn_add_Click(object sender, EventArgs e)
        {
            var text = Convert.ToDecimal(txt_amount.Text);

            try
            {
                using (BankCreditEntities bankCredit = new BankCreditEntities())
                {
                    bankCredit.Credits.Add(new Credit()
                    {
                        Person  = Person.ID,
                        Amount  = text,
                        Disburs = dateTimePicker1.Value.Date
                    });

                    bankCredit.SaveChanges();
                }
            }
            catch (Exception)
            {
                Type t = text.GetType();
                if (t != typeof(decimal))
                {
                    MessageBox.Show("Mebleg yalnis qeyd olub.Yeniden cehd edin");
                }
            }
        }
        private void btn_show_Click(object sender, EventArgs e)
        {
            AllData allData = new AllData();

            using (BankCreditEntities bank = new BankCreditEntities())
            {
                for (int i = 0; i < bank.People.ToList().Count; i++)
                {
                    allData.dataGridView1.Rows.Add();

                    allData.dataGridView1.Rows[i].Cells[0].Value = bank.People.ToList()[i].ID;
                    allData.dataGridView1.Rows[i].Cells[1].Value = bank.People.ToList()[i].Name;
                    allData.dataGridView1.Rows[i].Cells[2].Value = bank.Credits.ToList()[i].Amount;
                }
            }
            allData.ShowDialog();
        }