Esempio n. 1
0
        public async Task UserPassResetEmailJob(long UserID, string UserName, string UserEmail, string AppRoot, string ResetContext)
        {
            //string ResetContext = Guid.NewGuid().ToString().Replace("-", ""); //store the reset context ID
            ScheduleEmailInfoBM result = new ScheduleEmailInfoBM();

            result.To      = new string[] { UserEmail };
            result.Subject = string.Format("User: [{0}] login password has been reseted.", UserName);
            string TempContext  = string.Format("{0}/Account/ResetUserPass/{1}", AppRoot, ResetContext);
            string CompLogoLink = string.Format("{0}/img/Comp_logo.png", AppRoot);

            result.MailBody = _MailTemplate.UserPassResetTemplate(UserName, CompLogoLink, TempContext, "Beyoncetech Team", "3 day");

            Mjob DBJob = new Mjob
            {
                Command     = "ScheduleMail",
                CommandData = result.ToXMLString(),
                RefNo       = Guid.NewGuid().ToString(),
                Priority    = "1",
                Status      = 0,
                CreatedOn   = DateTime.Now,
                CreatedBy   = UserID,
                ValidFrom   = DateTime.Now,
                ValidTo     = DateTime.Now.AddDays(3)
            };

            await _DBRepository.Insert(DBJob).ConfigureAwait(false);
        }
Esempio n. 2
0
        public async Task Insert(Mjob entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            entities.Add(entity);
            await _DBContext.SaveChangesAsync();
        }
Esempio n. 3
0
        public async Task Update(Mjob entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            entities.Attach(entity);
            _DBContext.Entry(entity).State = EntityState.Modified;
            await _DBContext.SaveChangesAsync();
        }
Esempio n. 4
0
        public async Task AddJobOnQueue(AppJobBM oJob)
        {
            Mjob DBJob = new Mjob
            {
                JobId       = oJob.JobId,
                Command     = oJob.Command,
                CommandData = oJob.CommandData,
                RefNo       = oJob.RefNo,
                Priority    = oJob.Priority,
                CreatedOn   = oJob.CreatedOn,
                CreatedBy   = oJob.CreatedBy,
                Status      = oJob.Status,
                ValidFrom   = oJob.ValidFrom,
                ValidTo     = oJob.ValidTo
            };

            await _DBRepository.Insert(DBJob).ConfigureAwait(false);
        }