コード例 #1
0
 public AlertMessageCollection FetchAll()
 {
     AlertMessageCollection coll = new AlertMessageCollection();
     Query qry = new Query(AlertMessage.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
コード例 #2
0
        public async Task <IActionResult> logout(string returnUrl = null)
        {
            await _signInManager.SignOutAsync();

            _logger.LogInformation("User logged out.");
            AlertMessageCollection.AddSuccessAlert($"You have successfully signed out of {WebSiteOptions.WebSiteTitle}.");
            return(RedirectToLocal(returnUrl));
        }
コード例 #3
0
        public async Task <IActionResult> testemail(TestEmailModel model)
        {
            if (ModelState.IsValid)
            {
                var result = await _emailService.SendEmailAsync(new EmailMessage
                {
                    EmailAddress = model.Email,
                    Subject      = $"Test message from {WebSiteOptions.WebSiteTitle}",
                    Body         = $"This is a test message from {WebSiteOptions.WebSiteTitle}.{Environment.NewLine}{Environment.NewLine}{model.Message}"
                });

                if (result.Success)
                {
                    AlertMessageCollection.AddSuccessAlert($"Email sent to {model.Email}\n{result.Details}", "Email Sent!");
                }
                else
                {
                    AlertMessageCollection.AddDangerAlert(result.Details, "Email Failure");
                }
            }
            return(View());
        }
コード例 #4
0
 public void Setup()
 {
     _backingCollection      = new Dictionary <string, object>();
     _alertMessageCollection = new AlertMessageCollection(_backingCollection);
 }
コード例 #5
0
 public AlertMessageCollection FetchByQuery(Query qry)
 {
     AlertMessageCollection coll = new AlertMessageCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
コード例 #6
0
 public AlertMessageCollection FetchByID(object AlertID)
 {
     AlertMessageCollection coll = new AlertMessageCollection().Where("alertID", AlertID).Load();
     return coll;
 }