Exemple #1
0
        public Admin GetLoginAdmin(IAdminLoginData iAdminLoginData)
        {
            string password = StringSecure.Encrypt(iAdminLoginData.Password);

            Expression <Func <Administrator, bool> > func = adm =>
                                                            (adm.Username.Equals(iAdminLoginData.Username.Trim(), StringComparison.OrdinalIgnoreCase) ||
                                                             adm.Email.Equals(iAdminLoginData.Username.Trim(), StringComparison.OrdinalIgnoreCase)) &&
                                                            adm.Password == password;

            Admin admin = GetSingleFilteredAsInfo <Administrator, Admin>(func);

            return(Mapper.Map <Administrator, Admin>(GetDbContext().Administrators.FirstOrDefault(func)));
        }
Exemple #2
0
 protected override void Seed(PayContext context)
 {
     context.Administrators.AddOrUpdate(
         new Administrator
     {
         Id          = 1,
         Username    = "******",
         FirstName   = "Femi",
         LastName    = "Johnson",
         MiddleName  = "Jonathan",
         Email       = "*****@*****.**",
         Password    = StringSecure.Encrypt("femifemi"),
         PhoneNo     = 8136831102,
         HomeAddress = "Today's Solution",
         CreatedDate = new DateTime(2018, 6, 28)
     }
         );
 }