Пример #1
0
        public static string AdminLogin(LoginModel loginDetails)
        {
            string hashpassword = Hashpassword.ComputeSha256Hash(loginDetails.AdminPassword);

            string qry = String.Format("SELECT 1 FROM Admin where AdminUsername='******' and AdminPassword='******'", loginDetails.AdminUsername, hashpassword);

            return(ConnectionHandler.SqlQuery(qry));
        }
Пример #2
0
        public static string CreateUsers(UsersModel IncomingUser)
        {
            string uName = "Adm" + IncomingUser.AdminUsername;
            string today = DateTime.Now.ToString();

            string hashpassword = Hashpassword.ComputeSha256Hash(IncomingUser.AdminPassword);
            string qry          = String.Format("insert into Admin values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}')", IncomingUser.AdminFirstName, IncomingUser.AdminLastName, IncomingUser.AdminEmail, uName, hashpassword, IncomingUser.AdminRole, today);



            return(ConnectionHandler.SqlInsert(qry));
        }