Exemple #1
0
        internal static string ContactAccount(ContactAccount contactAccount, SNAPContext db)
        {
            try
            {
                ChangeLog changeLog = new ChangeLog();

                changeLog.Timestamp   = DateTime.Now;
                changeLog.Event       = "Contact Account Created";
                changeLog.Description = String.Format("{0} created", contactAccount.EmailAddress);
                changeLog.SubmittedBy = contactAccount.Creator;

                db.ChangeLogs.Add(changeLog);
                db.SaveChanges();

                return(changeLog.Description);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemple #2
0
        internal static string PasswordReset(ADUser adUser, IPrincipal user, SNAPContext db)
        {
            try
            {
                ChangeLog changeLog = new ChangeLog();

                changeLog.Timestamp   = DateTime.Now;
                changeLog.Event       = "Password Reset";
                changeLog.Description = String.Format("Password reset for {0}", adUser.EmailAddress);
                changeLog.SubmittedBy = user.Identity.Name;

                db.ChangeLogs.Add(changeLog);
                db.SaveChanges();

                return(changeLog.Description);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemple #3
0
        internal static string DistributionGroup(DistributionGroup distributionGroup, SNAPContext db)
        {
            try
            {
                ChangeLog changeLog = new ChangeLog();

                changeLog.Timestamp   = DateTime.Now;
                changeLog.Event       = "Distribution Group Created";
                changeLog.Description = String.Format("@{0} created", distributionGroup.Alias);
                changeLog.SubmittedBy = distributionGroup.Creator;

                db.ChangeLogs.Add(changeLog);
                db.SaveChanges();

                return(changeLog.Description);
            }
            catch (Exception)
            {
                return(null);
            }
        }