Пример #1
0
        private string ReplaceEmailListForRdlShipper(string arg)
        {
            string toEmails = "";
            string ccEmails = "";

            Emails.Clear();
            EMailList emailList = new EMailList(this);
            emailList.EnsureUserSelection(GetEmailListFromArg(arg, new string[] { "-TO", "-CC" }, "&quot", ';'));
            emailList.DisplayUserSelection(GetEmailListFromArg(arg, new string[] { "-TO", "-CC" }, "&quot", ';'));
            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("&quot"));
            if (arg.IndexOf("-CC "") > -1)
                ccEmails = arg.Substring(arg.IndexOf("-CC "") + 10).Substring(0, arg.Substring(arg.IndexOf("-CC "") + 10).IndexOf("&quot"));
            if (!toEmails.Equals(String.Empty))
                arg = arg.Replace(toEmails, newToEmails.TrimEnd(';'));
            if (!ccEmails.Equals(String.Empty))
                arg = arg.Replace(ccEmails, "");
            return arg;
        }
Пример #2
0
        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;
        }