TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
matt cupryk
NA
29
0
Email is send twice.
Apr 4 2011 12:43 AM
protected void btnSend_Click(object sender, EventArgs e)
{
Page.Validate();
if (Page.IsValid)
{
btnSend.Attributes["disabled"] = "disabled";
System.Threading.Thread.Sleep(2000);
string subject = txtSubject.Text.Trim();
string message = txtMessage.Text.Trim();
string toUser = null;
string ToUserName = null;
string FromUserName = null;
var replyToPM = SQLOmegaLoveProvider.GetPrivateMessageByID(this.ReplyToMessageId);
if (replyToPM != null)
{
if (replyToPM.ToProfileID == SQLOmegaLoveProvider.GetCurrentUserProfileID() || replyToPM.FromProfileID == SQLOmegaLoveProvider.GetCurrentUserProfileID())
{
toUser = lblToUserName.Text;
}
else
{
Response.Redirect("~/Secure/PrivateMessages.aspx");
}
}
else
{
if (Request.QueryString["UserNameID"] != null)
toUser = SQLOmegaLoveProvider.GetUserNameByProfileID(Convert.ToInt32(Request.QueryString["UserNameID"]));
}
if (toUser == null)
{
Response.Redirect("~/Secure/PrivateMessages.aspx");
}
ToUserName = SQLOmegaLoveProvider.GetUserNameByProfileID(Convert.ToInt32(ToProfileID));
FromUserName = SQLOmegaLoveProvider.GetUserNameByProfileID(FromProfileID);
var pm = SQLOmegaLoveProvider.InsertPrivateMessage(FromProfileID, ToProfileID,
subject, message, false, false, false, DateTimeHelper.ConvertToUtcTime(DateTime.Now));
System.Threading.Thread.Sleep(2000);
SMTPManager.SendPrivateMessage(FromUserName, ToUserName);
txtSubject.Text = "";
txtMessage.Text = "";
Response.Redirect("~/Secure/PrivateMessages.aspx?tab=sent");
}
}
Need to fix the above and have inside the txtmessage indicator being sent.
Reply
Answers (
3
)
Is programming a File Monitor/Watcher Application(C#) with WF4 possible?
Workflow Foundation