예제 #1
0
        //use case 1 : https://github.com/aviferdman/Workshop-on-Software-Engineering-Project/issues/11
        //using concurrent dictionary try add if usename already exist
        //than fail and return error message otherwise return success
        public async Task <string> SignUp(string username, string password, string phone)
        {
            if (username == null)
            {
                return("username cannot be null");
            }
            if (await usersDAL.AddDataUser(new DataUser(username, EncryptString(key, password), phone)))
            {
                await usersDAL.AddNewMemberState(username);

                await usersDAL.AddNewShoppingCart(username);

                return("success");
            }

            return("username: "******" is already taken please choose a different one");
        }