Esempio n. 1
0
        public static int ChangePassword(string accountId, string newPAssword, UserAccountTypes userType)
        {
            IUserAccountDAL userAccountDAL = null;

            switch (userType)
            {
            case UserAccountTypes.Employee:
                userAccountDAL = new LiteCommerce.DataLayers.SqlServer.EmployeeUserAccountDAL(_connectionString);
                break;

            case UserAccountTypes.Customer:
                userAccountDAL = new LiteCommerce.DataLayers.SqlServer.CustomerUserAccountDAL(_connectionString);
                break;

            default:
                throw new Exception("invalid type");
            }
            return(userAccountDAL.ChangePassword(accountId, newPAssword));
        }
Esempio n. 2
0
        public static int UpdateProfile(Object data, UserAccountTypes userType)
        {
            IUserAccountDAL userAccountDAL = null;

            switch (userType)
            {
            case UserAccountTypes.Employee:
                userAccountDAL = new LiteCommerce.DataLayers.SqlServer.EmployeeUserAccountDAL(_connectionString);
                break;

            case UserAccountTypes.Customer:
                userAccountDAL = new LiteCommerce.DataLayers.SqlServer.CustomerUserAccountDAL(_connectionString);
                break;

            default:
                throw new Exception("invalid type");
            }
            return(userAccountDAL.UpdateProfile(data));
        }