private static void GetOrCreateResourceStringManagerData()
        {
            ResourceStringManager.appStrings = HttpRuntime.Cache[CacheKey.ResourceStringCache] as List<AppResourceString>;

            if (ResourceStringManager.appStrings == null)
            {
                using (UnitOfWork unitOfWork = new UnitOfWork(new ChurchManagerEntities()))
                {
                    ResourceStringManager.appStrings = unitOfWork.context.AppResourceStrings.ToList();
                    HttpRuntime.Cache.Insert(CacheKey.ResourceStringCache, ResourceStringManager.appStrings, null, DateTime.Now.AddDays(100).Date, TimeSpan.Zero);
                }
            }
        }
Ejemplo n.º 2
0
 public SermonController()
 {
     this.unitOfWork = new UnitOfWork(new ChurchManagerEntities());
 }
 public SermonMetaDataController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public TagClassificationController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Ejemplo n.º 5
0
 public TagInfoController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingCheckController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountClassificationController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingTransactionController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Ejemplo n.º 9
0
 public PersonController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public PayrollDeductionAccountController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingPeriodAccountBalanceController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public MembershipAccountController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Ejemplo n.º 13
0
        public async Task<ActionResult> SendNewWebAccountEmail(MembershipAccountLoginSetupViewModel model)
        {
            var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
            var resultFromAccountCreation = await UserManager.CreateAsync(user, model.Password);
            string callbackUrl = null;

            if (resultFromAccountCreation.Succeeded)
            {
                var emailCode = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                var resultFromEmailConfirmation = await UserManager.ConfirmEmailAsync(user.Id, emailCode);

                var resultFromAddingMembershipRole = await UserManager.AddToRolesAsync(user.Id, AppRole.ActiveMember.ToString());

                if (resultFromAddingMembershipRole.Succeeded)
                {
                    using (UnitOfWork unitOfWork = new UnitOfWork(new ChurchManagerEntities()))
                    {
                        //Assign web account to a user
                        unitOfWork.context.Database.ExecuteSqlCommand(@"
                                                                UPDATE [dbo].[AspNetUsers]
                                                                   SET [PersonPrimaryInfoID] = @PersonPrimaryInfoID
                                                                 WHERE [Id] = @UserID
                                                                ", new SqlParameter("@UserID", user.Id), new SqlParameter("@PersonPrimaryInfoID", model.PersonPrimaryInfoID));

                        //Prompt user account Update
                        unitOfWork.context.Database.ExecuteSqlCommand(@"
                                                                UPDATE [dbo].[PersonPrimaryInfo]
                                                                    SET [PromptContactInformationUpdate] = 1
                                                                WHERE PersonPrimaryInfoID = @PersonPrimaryInfoID
                                                                ", new SqlParameter("@PersonPrimaryInfoID", model.PersonPrimaryInfoID));
                    }
                }

                //string code = UserManager.GeneratePasswordResetToken<ApplicationUser, string>(user.Id);
                //callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);

                ////if (HttpContext.Request.IsLocal)
                ////{
                ////    MandrillMailer mandrillMailer = new MandrillMailer();
                ////    mandrillMailer.SendNewMembershipAccountCreation(user.Email, callbackUrl);
                ////}

                //MandrillMailer mandrillMailer = new MandrillMailer();
                //mandrillMailer.SendNewMembershipAccountCreation(user.Email, callbackUrl);

                //TempData["SuccessAlertCustom"] = @"<strong>Success!</strong> Membership Enrollment Email Sent";
            }
            else
            {
                user = UserManager.FindByEmail(user.Email);
            }

            string code = UserManager.GeneratePasswordResetToken<ApplicationUser, string>(user.Id);
            callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);

            //if (HttpContext.Request.IsLocal)
            //{
            //    MandrillMailer mandrillMailer = new MandrillMailer();
            //    mandrillMailer.SendNewMembershipAccountCreation(user.Email, callbackUrl);
            //}

            MandrillMailer mandrillMailer = new MandrillMailer();
            mandrillMailer.SendNewMembershipAccountCreation(user.Email, callbackUrl);

            TempData["SuccessAlertCustom"] = @"<strong>Success!</strong> Membership Enrollment Email Sent";

            if (HttpContext.Request.IsLocal)
            {
                return RedirectToAction("ConfirmLink", new { link = callbackUrl });
            }
            else
            {
                return RedirectToAction("Index", "Person");
            }
        }
Ejemplo n.º 14
0
        private PersonPrimaryInfo DoLoginInitialization(ApplicationUser user)
        {
            PersonPrimaryInfo ppi;

            using (UnitOfWork unitOfWork = new UnitOfWork(new ChurchManagerEntities()))
            {
                ppi = unitOfWork.SQLQueryRepository.GetCurrentUsersPrimaryContactInfo(user.Id);
                SessionManager.CreateSession<PersonPrimaryInfo>(ppi, SessionName.User);
            }

            return ppi;
        }
 public DonorSimpleEntryController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public PersonPrimaryInfoController()
 {
     this.unitOfWork = new UnitOfWork(new ChurchManagerEntities());
 }
 public PayrollPersonTransactionController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingTransactionTemplateGroupController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public EventCategoryController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public PayrollReportController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Ejemplo n.º 21
0
 public DonorController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingPeriodTimeFrameController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingPeriodOpeningClosingTransactionController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountingVendorController(UnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }