/// <summary> /// Unique opens value must not be higher then the count of subscribers. /// </summary> private void GenerateOpenedEmailToIssue(int issueId, int uniqueOpens, IList <string> subscribersEmails) { for (var i = 0; i < uniqueOpens; i++) { var openedEmail = new OpenedEmailInfo { OpenedEmailEmail = subscribersEmails[i], OpenedEmailIssueID = issueId, OpenedEmailTime = GetRandomDate(DateTime.Now.AddMonths(-1), DateTime.Now.AddDays(-1)), }; OpenedEmailInfoProvider.SetOpenedEmailInfo(openedEmail); } }
private void GenerateOpenedEmailToIssue( int issueId, int uniqueOpens, IList <string> subscribersEmails) { for (var index = 0; index < uniqueOpens; ++index) { var infoObj = new OpenedEmailInfo(); infoObj.OpenedEmailEmail = subscribersEmails[index]; infoObj.OpenedEmailIssueID = issueId; var now = DateTime.Now; var from = now.AddMonths(-1); now = DateTime.Now; var to = now.AddDays(-1.0); infoObj.OpenedEmailTime = GetRandomDate(from, to); OpenedEmailInfoProvider.SetOpenedEmailInfo(infoObj); } }