Exemplo n.º 1
0
        /// <summary>
        /// Loads the specified work item based on a job id and an email address.
        /// </summary>
        /// <param name="jobId">The job id.</param>
        /// <param name="emailAddress">The email address.</param>
        /// <returns>A JobWorkItem if job and email found, null it not</returns>
        public static JobWorkItem Load(int jobId, string emailAddress)
        {
            WorkItemData dataUtil = GetWorker();
            // Get it, making sure we pass a washed address
            DataRow workRow = dataUtil.WorkItemGet(jobId, NewsLetterUtil.CleanEmailAddress(emailAddress));

            if (workRow != null)
            {
                return(new JobWorkItem(workRow));
            }
            else
            {
                return(null);
            }
        }