private void metroButton1_Click(object sender, EventArgs e)
        {
            DialogResult re = MessageBox.Show("Do you want to Logout!", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (re == DialogResult.No)
            {
                this.Show();
                Txtpanel.Hide();
            }
            else
            {
                Application.Exit();
            }
        }
 private void AdminForm_Click(object sender, EventArgs e)
 {
     Txtpanel.Hide();
     ProfileBox.Hide();
 }
 private void circularPictureBox2_Click(object sender, EventArgs e)
 {
     Txtpanel.Hide();
     ProfileBox.Hide();
 }
 private void TxtProfile_Click(object sender, EventArgs e)
 {
     ProfileBox.Show();
     Txtpanel.Hide();
 }
 private void ProfilePic_Click(object sender, EventArgs e)
 {
     Txtpanel.Hide();
 }
        private void AdminForm_Load(object sender, EventArgs e)
        {
            Txtnick.Enabled    = false;
            Txtemail.Enabled   = false;
            Txtphone.Enabled   = false;
            Txtmobile.Enabled  = false;
            Txtgender.Enabled  = false;
            Txtaage.Enabled    = false;
            Txtaddress.Enabled = false;

            ProfileBox.Hide();

            Txtid.Text = Login.passtext;
            ////chart view in main
            //try
            //{
            //    con.Open();
            //    SqlCommand cmd = new SqlCommand("select * from Saleinfor",con);
            //    SqlDataReader rd = cmd.ExecuteReader();
            //    Series sr = new Series();
            //    while (rd.Read())
            //    {
            //        chart1.Series[0].Points.AddY(rd.GetInt32(23));
            //    }
            //    con.Close();

            //}
            //catch (Exception)
            //{

            //}
            toolStripStatusLabel.BackColor = Color.LightBlue;
            timer.Text = DateTime.Now.ToLongTimeString();
            timer1.Start();
            Txtpanel.Hide();
            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                string ad = "select * from information where email_id='" + Txtid.Text + "'";

                SqlCommand    cmd = new SqlCommand(ad, con);
                SqlDataReader sr  = cmd.ExecuteReader();
                while (sr.Read())
                {
                    string va2 = sr[1].ToString();
                    TxtShowName.Text = Convert.ToString(sr[1].ToString());
                    label1.Text      = Convert.ToString(sr[1].ToString());

                    string val = sr[8].ToString();
                    Txtuser.Text = Convert.ToString(sr[8].ToString());
                    label2.Text  = Convert.ToString(sr[8].ToString());

                    string val3 = sr[0].ToString();
                    label3.Text = Convert.ToString(sr[0].ToString());

                    Txtnick.Text    = Convert.ToString(sr[2].ToString());
                    Txtemail.Text   = Convert.ToString(sr[3].ToString());
                    Txtgender.Text  = Convert.ToString(sr[4].ToString());
                    Txtaage.Text    = Convert.ToString(sr[5].ToString());
                    Txtphone.Text   = Convert.ToString(sr[6].ToString());
                    Txtmobile.Text  = Convert.ToString(sr[7].ToString());
                    Txtaddress.Text = Convert.ToString(sr[9].ToString());

                    if (sr.HasRows)
                    {
                        byte[] img = (byte[])(sr[10]);
                        if (img == null)
                        {
                            circularPictureBox2.Image = null;
                            circularPictureBox3.Image = null;
                            circularPictureBox4.Image = null;
                        }
                        else
                        {
                            MemoryStream ms = new MemoryStream(img);
                            circularPictureBox2.Image = Image.FromStream(ms);
                            circularPictureBox3.Image = Image.FromStream(ms);
                            circularPictureBox4.Image = Image.FromStream(ms);
                        }
                    }
                }
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (Txtuser.Text == "Admin")
                {
                    employeeToolStripMenuItem.Enabled         = true;
                    EmployeeRegisterToolStripMenuItem.Enabled = true;
                }
                else
                {
                    employeeToolStripMenuItem.Enabled         = false;
                    EmployeeRegisterToolStripMenuItem.Enabled = false;
                }
            }
        }