private void editprofilebtn_Click(object sender, EventArgs e)
 {
     ServiceBRAdmin.Branch_Admin admin = new ServiceBRAdmin.Branch_Admin();
     admin.Id      = UserInfo.id;
     admin.Name    = adminname.Text;
     admin.Email   = adminemail.Text;
     admin.Contact = admincontact.Text;
     admin.DOB     = admindob.Value;
     if (adminpassword.Text == confirmpassword.Text)
     {
         admin.Password = adminpassword.Text;
         ServiceBRAdmin.BranchAdminData data = new ServiceBRAdmin.BranchAdminData();
         data = a.updateBranchAdmin(admin);
         if (data != null)
         {
             MessageBox.Show("Updated", "updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
             confirmpassword.Text = "";
         }
         else
         {
             MessageBox.Show("Error", "Info !", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("Confirm Password and Password not same", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void NewBrAdminBtn_Click(object sender, EventArgs e)
        {
            if (BrAdminName.Text == String.Empty || Contact.Text == String.Empty || EmailId.Text == String.Empty || NewBrAdminpassword.Text == String.Empty)
            {
                MessageBox.Show("Fill all Fields", "Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                bradmin.Name     = BrAdminName.Text;
                bradmin.Contact  = ContactNo.Text;
                bradmin.Email    = EmailId.Text;
                bradmin.DOB      = NewBrAdminDOB.Value;
                bradmin.Password = NewBrAdminpassword.Text;

                ServiceBRAdmin.Branch_Admin data = new ServiceBRAdmin.Branch_Admin();
                data = s.addBranchAdmin(bradmin);
                if (data != null)
                {
                    MessageBox.Show("Admin added successfully", "INFO!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    load_data();
                    All.BringToFront();
                }
                else
                {
                    MessageBox.Show("Try Again some thing wents wrong", "INFO!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }