Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: new custom fields on cst_account.aspx.cs

  1. #1
    press is offline Member
    Join Date
    May 2009
    Posts
    31

    Default new custom fields on cst_account.aspx.cs

    I am working on adding some fields to the cst_account.aspx.cs page. These fields need to be updated. There are not extentiondata, so that method wont work.

    They display ok with this code:

    writer.Write(" <tr>");
    writer.Write(" <td width=\"25%\" align=\"right\" valign=\"middle\">Membership ID</td>");
    writer.Write(" <td width=\"75%\" align=\"left\" valign=\"middle\">");
    writer.Write(" <input type=\"text\" name=\"NewMemberID\" size=\"14\" maxlength=\"20\" value=\"" + DB.GetSqlS("SELECT membershipid AS S FROM Customer where CustomerID=" + TargetCustomer.CustomerID.ToString()) + "\">");
    writer.Write(" </td>");
    writer.Write(" </tr>");

    writer.Write(" <tr>");
    writer.Write(" <td width=\"25%\" align=\"right\" valign=\"middle\">Membership Type</td>");
    writer.Write(" <td width=\"75%\" align=\"left\" valign=\"middle\">");
    writer.Write(" <input type=\"text\" name=\"NewMemberType\" size=\"14\" maxlength=\"20\" value=\"" + DB.GetSqlS("SELECT membershiptype AS S FROM Customer where CustomerID=" + TargetCustomer.CustomerID.ToString()) + "\">");
    writer.Write(" </td>");
    writer.Write(" </tr>");

    I want to run the following code, from somewhere. I just have not found where or how to make it work. I tried to put it in the cst_account_process.aspx.cs and in the same page. I am not sure i am referring to the input fields correctly. All sql backend fields are string.


    String sql = "UPDATE Customer SET " +
    "MembershipID = " + DB.SQuote(NewMemberID) + ", " +
    "MembershipType = " + DB.SQuote(NewMemberType) +
    " WHERE CustomerID = " + ThisCustomer.CustomerID.ToString();

    DB.ExecuteSQL(sql);


    Any ideas?

  2. #2
    press is offline Member
    Join Date
    May 2009
    Posts
    31

    Default Any help on this one?

    surely someone has done this before??

  3. #3
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    cst_account_process.aspx.cs was the correct place to update the record. However you used ThisCustomer instead of TargetCustomer in your update code. Which would mean the currently logged in admin account has those fields updated instead. Try your update statement using TargetCustomer instead.