protected void Button1_Click(object sender, EventArgs e)
        {
            string gender = "";

            Models.Connection   con  = new Models.Connection();
            Models.UserRegister user = new Models.UserRegister();
            user.UName  = TextBox1.Text;
            user.UEmail = TextBox2.Text;
            user.UPass  = TextBox3.Text;
            if (RadioButton1.Checked)
            {
                gender = "Male";
            }
            else if (RadioButton2.Checked)
            {
                gender = "Female";
            }
            user.UGender  = gender;
            user.UContact = TextBox4.Text;
            user.signUp(user);
            Models.Email em = new Models.Email();
            em.email   = TextBox2.Text;
            em.Subject = "Thank You So Much For Registration";
            em.Body    = "testing Body"; //will be changed later
            em.SendEmail(em);
            Response.Write("<script>alert('Successfully Regsitered...check Your mail')</script>");
            Models.ClearText ct = new Models.ClearText();
            ct.ClearTextbox(TextBox1, TextBox2, TextBox3, TextBox4);
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Models.Connection con   = new Models.Connection();
            string            query = "select UEmail from UserReg where UName = '" + DropDownList1.Text + "'";
            SqlCommand        com   = new SqlCommand(query, con.getConnection());
            SqlDataReader     rd    = com.ExecuteReader();

            while (rd.Read())
            {
                u.UEmail = rd["UEmail"].ToString();
            }
            TextBox8.Text = u.UEmail;
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Models.Question ques = new Models.Question();
            ques.DateQuest = DateTime.Now.ToString();
            string query = "select Uid from UserReg where UEmail = '" + Session["UserInfo"].ToString() + "'";

            ques.Quest = TextBox1.Text;
            Models.Connection con  = new Models.Connection();
            SqlCommand        com5 = new SqlCommand(query, con.getConnection());
            SqlDataReader     rd   = com5.ExecuteReader();

            while (rd.Read())
            {
                ques.Uid = Convert.ToInt32(rd["Uid"]);
            }
            ques.Add(ques);
            Response.Write("<script>alert('Published...Please wait for the reply')</script>");
            Models.ClearText ct = new Models.ClearText();
            ct.ClearTextbox(TextBox1);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Models.Email      ee  = new Models.Email();
            Models.Connection con = new Models.Connection();
            SqlCommand        com = new SqlCommand("select * from login", con.getConnection());
            SqlDataReader     rd  = com.ExecuteReader();

            while (rd.Read())
            {
                ee.email = TextBox1.Text;
                string em   = rd["Email"].ToString();
                string pass = rd["Password"].ToString();
                if (ee.email == em)
                {
                    ee.Body    = pass;
                    ee.Subject = "Password Recovery";
                    //ee.email = em;
                    ee.SendEmail(ee);
                    Response.Write("<script>alert('Email Sent Successfully')</script>");
                }
            }
        }