Click here to Skip to main content
13,351,457 members (45,386 online)
Rate this:
Please Sign up or sign in to vote.
See more:

we have developed a web application using with c#. at some point of time we facing a very diificult issue.

let me explain my issue,

Two users(A and B) send Email at same time using mailmessage.
that Email body content was change B user Email body content goes to A user.

public override string SendReplyMail_To_Client(string TICKETNUMBER, string REPLYMESSAGE, int TemplateNumber, int Portal_Id, int Module_Id, string FromEmail, string ToEmail, string Att, string Added_CC, string subject, out string Error, out string ReplyError)

ds_reply_mail = DataProvider.Instance().Get_EmailTemplates_By_TemplateNumber(SqlParam);
EmailSubject = ds_reply_mail.Tables[0].Rows[0]["EmailSubject"].ToString().Trim();
                         EmailText = DataProvider.Instance().Get_String((Byte[])ds_reply_mail.Tables[0].Rows[0]["EmailText"]);

for (int ColumnIndex = 0; ColumnIndex < ds_ticket.Tables[0].Columns.Count; ColumnIndex++)
                           if (EmailText.Contains(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()))
                               if (ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim() != "#REQUESTDESC#")
                                   EmailText = EmailText.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(), ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()].ToString().Trim());
                                   //EmailSubject = EmailSubject.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(), ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()].ToString().Trim());
                                   EmailText = EmailText.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(),  DataProvider.Instance().Get_String((Byte[])ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()]));
                                  // EmailSubject = EmailSubject.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(), ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()].ToString().Trim());

                       // Email Subject Replacement
                       for (int ColumnIndex = 0; ColumnIndex < ds_ticket.Tables[0].Columns.Count; ColumnIndex++)
                           if (EmailSubject.Contains(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()))
                               if (ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim() != "#REQUESTDESC#")
                                  EmailSubject = EmailSubject.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(), ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()].ToString().Trim());
                                   EmailSubject = EmailSubject.Replace(ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim(), ds_ticket.Tables[0].Rows[0][ds_ticket.Tables[0].Columns[ColumnIndex].ColumnName.Trim()].ToString().Trim());

                       if (EmailText.Contains("#REPLYMESSAGE#"))
                           EmailText = "<font style='color:Black'>" + EmailText.Replace("#REPLYMESSAGE#", REPLYMESSAGE) + "</font>";//EmailText.Replace("#REPLYMESSAGE#", REPLYMESSAGE);

                       MailMessage Mail = new MailMessage();
                       Mail.From = FromEmail;

Mail.To = cc;
if (subject != null && subject != "")
                               Mail.Subject = subject;
                               Mail.Subject = EmailSubject;
                           Mail.BodyFormat = MailFormat.Html;
   Mail.Body = EmailText;
                                SmtpMail.SmtpServer = Get_SMTP_Host_Server_Name();

how can i handle this issue in my application?
Posted 4-Feb-13 21:13pm
Updated 5-Feb-13 4:51am
OriginalGriff 5-Feb-13 2:49am
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
Edo Tzumer 5-Feb-13 4:47am
forget the question, it's a horrible title...
avmvijay 6-Feb-13 3:55am
what u mean?
Edo Tzumer 6-Feb-13 4:58am
The title should have a short description of the nature of the issue you encounter.

Stating that you have an issue to resolve is a waste of the title, since that is clear by the fact that you are posting a question.
Furthermore - the title is used for searches of similar old questions that have already been anwered. So by not providing details your question will be of less use to future users.
Rahul Dhoble 5-Feb-13 3:48am
avmvijay , Can you predict smell of coffee by seeing "ASAM" in indian map ?
We are CP member not astrologers.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Without seeing your code, we can't be precise, but I would suggest that you need to look at what you are doing - somehow you are using information as if your app was the only one running.
1) You should not be using static variables.
2) You should not be storing information is a single place in a database and assuming that no other user can also see it.
3) You should not be using the "highest value" as the "my value" to provide an ID - if another user does the same thing inbetween your write and your read, you will get his values.

You should be using the Session object, or Cookies on the user PC to transfer data from page to page.

Sorry if this is all vague, but without information we can be no more accurate.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100