private string ReplaceEmailListForRdlShipper(string arg) { string toEmails = ""; string ccEmails = ""; Emails.Clear(); EMailList emailList = new EMailList(this); emailList.EnsureUserSelection(GetEmailListFromArg(arg, new string[] { "-TO", "-CC" }, """, ';')); emailList.DisplayUserSelection(GetEmailListFromArg(arg, new string[] { "-TO", "-CC" }, """, ';')); emailList.ShowDialog(); string newToEmails = ""; foreach (string email in Emails) newToEmails += String.Format("{0},{1};", email, ((DataRow)((DataRow[])dsUsers.Tables[0].Select("NameSort='" + email + "'"))[0])["ExternalUserName"]); if (arg.IndexOf("-To "") > -1) toEmails = arg.Substring(arg.IndexOf("-To "") + 10).Substring(0, arg.Substring(arg.IndexOf("-To "") + 10).IndexOf(""")); if (arg.IndexOf("-CC "") > -1) ccEmails = arg.Substring(arg.IndexOf("-CC "") + 10).Substring(0, arg.Substring(arg.IndexOf("-CC "") + 10).IndexOf(""")); if (!toEmails.Equals(String.Empty)) arg = arg.Replace(toEmails, newToEmails.TrimEnd(';')); if (!ccEmails.Equals(String.Empty)) arg = arg.Replace(ccEmails, ""); return arg; }
private string ReplaceEmailListForSoapReport(string arg) { Emails.Clear(); EMailList emailList = new EMailList(this); emailList.EnsureUserSelection(GetEmailListFromArg(arg, new string[] { "listTo" }, "\"", ' ' )); emailList.DisplayUserSelection(GetEmailListFromArg(arg, new string[] { "listTo" }, "\"", ' ' )); emailList.ShowDialog(); string newToEmails = ""; foreach (string email in Emails) newToEmails += String.Format("{0},{1};", email, ((DataRow)((DataRow[])dsUsers.Tables[0].Select("NameSort='" + email + "'"))[0])["ExternalUserName"]); string toEmails = arg.Substring(arg.IndexOf("listTo=\"") + 8).Substring(0, arg.Substring(arg.IndexOf("listTo=\"") + 8).IndexOf("\"")); arg = arg.Replace(toEmails, newToEmails.TrimEnd(';')); return arg; }