Ejemplo n.º 1
0
        private void modifyButton_Click(object sender, System.EventArgs e)
        {
            //	Create a generic to update user information
            ClarifyGeneric generic = dataSet.CreateGeneric(userTable);

            //  Query the record by the current users id
            generic.AppendFilter("objid", NumberOps.Equals, (int)session[userTable + ".id"]);

            //	Select the fields to include in the query
            generic.DataFields.Add("first_name");
            generic.DataFields.Add("last_name");
            generic.DataFields.Add("phone");

            //	Execute the query
            generic.Query();

            //	Update the values of the fields from the data on the page
            generic[0]["first_name"] = firstName.Text;
            generic[0]["last_name"]  = lastName.Text;
            generic[0]["phone"]      = phone.Text;

            //	Update the record in the database
            generic[0].Update();

            //	Refresh the session context
            session.RefreshContext();

            //	Reload the page to show updated data
            Response.Redirect("profile.aspx", true);
        }
 public void RefreshContext()
 {
     ClarifySession.RefreshContext();
 }