private void SignIn_Click(object sender, EventArgs e)
 {//the exception is thrown when no shop manager is register.
     if (Admin.Authenticate(this.Password.Text))
     {
         //load further fronts;
         AdminProfile adminProfile = new AdminProfile(Admin);
         this.Controls.Add(adminProfile);
         adminProfile.Dock = DockStyle.Fill;
         adminProfile.BringToFront();
     }
     else
     {
         MessageBox.Show("Wrong Password ");
     }
     Password.Clear();
 }
 private void UpdateSM_Click(object sender, EventArgs e)
 {
     if (radioButton1.Checked)
     {
         if (Admin.Authenticate(textBox1.Text))
         {
             string imgloc;
             if (IsImgUploaded)
             {
                 imgloc = Admin.SaveImage(o1.FileName);
                 Admin.UpdateShopManagerAccount(ShopManager.Text, textBox2.Text, ContactNumber.Text, Address.Text, imgloc);
                 ShopManager.Clear();
                 UserID.Clear();
                 textBox1.Clear();
                 textBox2.Clear();
                 ContactNumber.Clear();
                 Address.Clear();
                 Date.Text            = "";
                 pictureBox1.Image    = pictureBox1.InitialImage;
                 radioButton1.Checked = false;
                 radioButton2.Checked = false;
             }
             else
             {
                 imgloc = pictureBox1.ImageLocation;
                 Admin.UpdateShopManagerAccount(ShopManager.Text, textBox2.Text, ContactNumber.Text, Address.Text, imgloc);
                 ShopManager.Clear();
                 UserID.Clear();
                 textBox1.Clear();
                 textBox2.Clear();
                 ContactNumber.Clear();
                 Address.Clear();
                 Date.Text            = "";
                 pictureBox1.Image    = pictureBox1.InitialImage;
                 radioButton1.Checked = false;
                 radioButton2.Checked = false;
             }
         }
         else
         {
             MessageBox.Show("Wrong Current Password");
         }
     }
     else
     {
         string imgloc;
         if (IsImgUploaded)
         {
             imgloc = Admin.SaveImage(o1.FileName);
             Admin.UpdateShopManagerAccount(ShopManager.Text, ContactNumber.Text, Address.Text, imgloc);
             ShopManager.Clear();
             UserID.Clear();
             textBox1.Clear();
             textBox2.Clear();
             ContactNumber.Clear();
             Address.Clear();
             Date.Text            = "";
             pictureBox1.Image    = pictureBox1.InitialImage;
             radioButton1.Checked = false;
             radioButton2.Checked = false;
         }
         else
         {
             imgloc = pictureBox1.ImageLocation;
             Admin.UpdateShopManagerAccount(ShopManager.Text, ContactNumber.Text, Address.Text, imgloc);
             ShopManager.Clear();
             UserID.Clear();
             textBox1.Clear();
             textBox2.Clear();
             ContactNumber.Clear();
             Address.Clear();
             Date.Text            = "";
             pictureBox1.Image    = pictureBox1.InitialImage;
             radioButton1.Checked = false;
             radioButton2.Checked = false;
         }
     }
 }