private void Form2_Load_1(object sender, EventArgs e)
        {
            memberController mc      = new memberController();
            List <member1>   memlist = mc.GetAllmember();

            this.dataGridView1.DataSource = memlist;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            memberController mc = new memberController();

            if (this.textBox1.Text == Convert.ToString(mc.GetAllmember().Count() + 1))
            {
                member1 newmember = new member1();
                newmember.MemberId   = Convert.ToInt32(this.textBox1.Text);
                newmember.MemberName = this.textBox2.Text;
                string G = "";
                if (this.radioButton1.Checked)
                {
                    G = "M";
                }
                else
                {
                    G = "F";
                }
                newmember.Gender      = G;
                newmember.DateOfBirth = this.dateTimePicker1.Value.Date.ToString();
                newmember.Address1    = this.textBox3.Text;
                newmember.Phone       = this.textBox4.Text;

                mc.Addmember(newmember);

                MessageBox.Show("saved");
                button1_Click(null, null);
            }
            else
            {
                member1 a = mc.Getmember(Convert.ToInt32(this.textBox1.Text));

                a.MemberName = this.textBox2.Text;
                string G = "";
                if (this.radioButton1.Checked)
                {
                    G = "M";
                }
                else
                {
                    G = "F";
                }
                a.Gender      = G;
                a.DateOfBirth = this.dateTimePicker1.Value.Date.ToString();
                a.Address1    = this.textBox3.Text;
                a.Phone       = this.textBox4.Text;

                mc.ModifymemberInfo(a);

                MessageBox.Show("update successfully");
                button1_Click(null, null);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            memberController mc = new memberController();

            this.textBox1.Text         = Convert.ToString(mc.GetAllmember().Count() + 1);
            this.textBox2.Text         = "";
            this.textBox3.Text         = "";
            this.textBox4.Text         = "";
            this.radioButton1.Checked  = false;
            this.radioButton2.Checked  = false;
            this.dateTimePicker1.Value = DateTime.Now;
        }