protected void btnupdate_Click(object sender, EventArgs e)
    {
        ob.Email = Session["Email"].ToString();
        String s  = txtPass1.Text;
        String s1 = "";
        int    l  = s.Length;
        int    i;

        try
        {
            for (i = l - 1; i >= 0; i--)
            {
                if (i > 0)
                {
                    s1 = s1 + (int)s[i] + "?";
                }
                else
                {
                    s1 = s1 + (int)s[i];
                }
            }
            ob.Password = s1;

            {
                String query = "update tbluserrecord set Password='******' where Email='" + ob.Email + "'";
                ob.Update(query, ob.Email);
                lblmsg.Text = "PASSWORD Updated Successfully";
            }
        }
        catch (Exception err)
        {
            lblmsg.Text = err.Message;
        }
    }
Esempio n. 2
0
 protected void btnFeedback_Click(object sender, EventArgs e)
 {
     try
     {
         ob.Email    = Session["Email"].ToString();
         ob.Feedback = txtFeedback.Text;
         String query = "Update tbluserrecord set Feedback='" + ob.Feedback + "' where Email='" + ob.Email + "'";
         ob.Update(query, ob.Email);
         txtFeedback.Text = "";
         lblmsg.Text      = "Thank You For Your Feedback";
     }
     catch (Exception err)
     {
         lblmsg.Text = err.Message;
     }
 }
 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
 {
     try
     {
         int     rowupdate  = e.RowIndex;
         TextBox txtname    = (TextBox)GridView1.Rows[rowupdate].Cells[1].Controls[0];
         TextBox txtaddress = (TextBox)GridView1.Rows[rowupdate].Cells[2].Controls[0];
         TextBox txtmobile  = (TextBox)GridView1.Rows[rowupdate].Cells[3].Controls[0];
         String  email      = (String)GridView1.Rows[rowupdate].Cells[4].Text;
         // String password = (String)GridView1.Rows[rowupdate].Cells[5].Text;
         String  query  = "update tbluserrecord set Name='" + txtname.Text + "',Address='" + txtaddress.Text + "',Mobile='" + txtmobile.Text + "' where Email='" + email + "'";
         clsuser objreg = new clsuser();
         objreg.Update(query, email);
         //remove the edit mode
         GridView1.EditIndex = -1;
         populateGridview();
     }
     catch (Exception err)
     {
         lblmsg.Text = err.Message;
     }
 }