Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stringbuilder question

Status
Not open for further replies.

Sanjeet1

Programmer
Sep 4, 2003
26
US
I would like to include the Title.Text,CategoyId.SelectedItem.Text,EditAuthor.Text,StatusId.SelectedItem.Text, info in my email notification.

I am sending an email to the submitter of a case. I am getting the info I need to send from the controls on the screen. Here is my code:

private void sendConfirmationEmailSubmitter()
{

//Retreive Email for Submitter
UserController uc = new UserController();
UserInfo ui = new UserInfo();
ui = uc.GetUser(this.PortalId,this.UserId);
//string EMailSubmitter = ui.Email;

// OnlineCaseReviewerController controller = new OnlineCaseReviewerController();
// ArrayList editors = controller.GetEditors();

StringBuilder sb = new StringBuilder();
sb.AppendFormat( "{0};", ui.Email );
sb.Append(Title.Text,CategoyId.SelectedItem.Text,EditAuthor.Text,StatusId.SelectedItem.Text);

controller = null;
editors = null;
string url = string.Format( " Request.ServerVariables[ "SERVER_NAME" ], this.TabId, _caseId );
DotNetNuke.Globals.SendNotification( "nobody@aans.org", sb.ToString(), String.Empty, "Online Case submitted",
string.Format( "The following case has been submitted:\r\n\r\n{0}\r\n\r\n To review, please go to {1}", _case.Title, url),
null, null, null );
sb = null;

}
 
that's two statements without a question.

what would you like help with?


mr s. <;)

 
1. I would like to retrieve all the values from the form:

Title.Text,CategoyId.SelectedItem.Text,EditAuthor.Text,StatusId.SelectedItem.Text

Apend these to the sting builder class.

2. Infor the submitter: sb.AppendFormat( "{0};", ui.Email );. This shoul dgive me the users email.
and inform the submitter through email all the information of:

Title.Text,CategoyId.SelectedItem.Text,EditAuthor.Text,StatusId.SelectedItem.Text

Thank you.
 
split out the line:

Code:
sb.Append(Title.Text,CategoyId.SelectedItem.Text,EditAuthor.Text,StatusId.SelectedItem.Text);

into its constituent parts:

Code:
sb.Append(Title.Text); 
sb.Append(CategoyId.SelectedItem.Text); 
sb.Append(EditAuthor.Text); 
sb.Append(StatusId.SelectedItem.Text);

assuming the controls referenced are visible (in scope) from the function you should have no problems.


mr s. <;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top