public IQueryable <AddressVerificationTrx> GetTrxFor(VerificaionStatusENUM verificaionStatusEnum) { var trx = FindAll() .Where(x => x.Verification.VerificaionStatusEnum == verificaionStatusEnum); return(trx); }
private AddressVerificationHdr CreateVerificationMailingListFor(Mailer mailer, MailServiceENUM mailServiceEnum, MailLocalOrForiegnENUM mailLocalOrForiegnEnum, VerificaionStatusENUM VerificaionStatusEnum) { List <AddressVerificationTrx> mailingList = createVerificationListFor(mailer, mailLocalOrForiegnEnum, mailServiceEnum, VerificaionStatusEnum); if (mailingList.IsNullOrEmpty()) { return(null); } updateTrxs(mailingList); AddressVerificationHdr header = AddressVerificationHdrBiz.Factory() as AddressVerificationHdr; string dateTickStr = DateTime.UtcNow.Ticks.ToString(); dateTickStr = dateTickStr.Substring(dateTickStr.Length - 5); //gets last 5 digits header.Name = string.Format("{1} -{0} ", dateTickStr, UserName); header.AddBeginAndEndDateController(mailLocalOrForiegnEnum, mailServiceEnum, UserName, UserId); header.MailLocalOrForiegnEnum = mailLocalOrForiegnEnum; header.MailServiceEnum = mailServiceEnum; header.BatchNo = getNextBatchNo(); header.BeginDate.SetToTodaysDate(UserName, UserId); header.EndDate.SetToTodaysDate(UserName, UserId); int timeAllowed = NoOfDaysAllowed(mailServiceEnum, mailLocalOrForiegnEnum); header.EndDate.Date = header.EndDate.Date.Value.AddDays(timeAllowed); header.Verification.SetTo(VerificaionStatusENUM.SelectedForProcessing); //header.SuccessEnum = SuccessENUM.Inproccess; //db stuff header.MailerId = mailer.Id; header.Mailer = mailer; mailer.AddressVerificationHdrs.Add(header); header.AddressVerificationTrxs = mailingList; return(header); }
private List <AddressVerificationTrx> createVerificationListFor(Mailer mailer, MailLocalOrForiegnENUM mailLocalOrForiegnEnum, MailServiceENUM mailServiceEnum, VerificaionStatusENUM VerificaionStatusEnum) { checkIfMailerIsAllowedAnyMoreMailingsIfNotThrowException_Helper(mailer); //Check to see if there are any mails for verification if (areThereAnyAddressesForVerificationFor_Helper(mailServiceEnum, mailLocalOrForiegnEnum)) { //get the number allowed to the user int qtyAllowedToUser = getNumbrOfLettersAllowedToUserIfZeroThrowException_Helper(mailer, mailServiceEnum); //this gets the list List <AddressVerificationTrx> list = getVerificationTrxFor_SQL(mailServiceEnum, mailLocalOrForiegnEnum) .Where(x => x.Verification.VerificaionStatusEnum == VerificaionStatusEnum) .ToList(); list.IsNullOrEmptyThrowException("Sorry. There are no open verification requests for Pakistan."); List <AddressVerificationTrx> lstOfAddys = createListOfVerificationAddresses(qtyAllowedToUser, list); return(lstOfAddys); } throw new Exception(string.Format("Sorry. There are no open verification requests.")); }