资源简介
1、经理权限:
会员的添加和移除;
会员基本情况的查询功能;
会员的消费记录查询功能;
会员续卡功能;
2、会员权限:
个人基本情况的查询及更改;
消费记录的查询;
私教课程的购买;
健身课程表;
3、游客权限:
健身房基本情况查询(健身设施,健身

代码片段和文件信息
#!/usr/bin/env python3
# _*_ coding: utf-8 _*_
# Date: 2019/8/29 0029 11:09
# Author: Mijiu
# Version: 1.0
import os
import abc
import csv
import time
import datetime
from unit import *
from Settings import *
class Model(metaclass=abc.ABCmeta):
“““抽象类不能被实例化. 用来被别的类继承“““
title = [“id“]
@abc.abstractmethod # 把init编程抽象方法让他不能被实例坏
def __init__(self file_name):
self.file_name = file_name
if os.path.exists(file_name):
self.id = self.id_auto_increment()
else:
self.id = None
def create(self data=None):
“““创建数据文件“““
if data is None:
data = self.title
if os.path.exists(self.file_name): # 路径是否存在(如果存在不创建)
print(f“{os.path.basename(self.file_name)}文件已存在“)
return
else: # 否则创建文件
with open(self.file_name “w“ encoding=“utf-8“ newline=““) as f:
csv_write = csv.writer(f)
if data and isinstance(data (list tuple)):
csv_write.writerow(data)
def drop(self):
“““删除数据文件“““
if os.path.exists(self.file_name): # exists 路径是否存在
os.remove(self.file_name) # 删除
else:
print(f“{os.path.basename(self.file_name)}不存在!不能删除!“)
def insert_one(self data=None):
“““插入一条数据“““
if data is None:
data = str(self).split(““)
if os.path.exists(self.file_name): # 如果这个文件存在就追加一条数据
with open(self.file_name “a“ encoding=“utf-8“ newline=““) as f:
csv_write = csv.writer(f)
if data and isinstance(data (list tuple)): # 如果数据line不为空 就写入
csv_write.writerow(data)
else:
print(f“{os.path.basename(self.file_name)}不存在!请先创建!“)
def insert_many(self data):
“““插入多条数据“““
if os.path.exists(self.file_name): # 如果这个文件存在就追加多条数据
with open(self.file_name “a“ encoding=“utf-8“ newline=““) as f:
csv_write = csv.writer(f)
if data and isinstance(data (list tuple)): # 如果数据line不为空 就写入
csv_write.writerows(data) # writerows csv中写入多行数据
else:
print(f“{os.path.basename(self.file_name)}不存在!请先创建!“)
def find_all(self):
“““查找整个文件“““
data = []
if os.path.exists(self.file_name):
with open(self.file_name encoding=“utf-8“) as f:
data = list(csv.reader(f))
return data
def find(self field_name value):
“““
通过条件查询数据(模糊查询)
:param field_name: 字段名 str
:param value: 需要查询的值 str
:return: list
“““
results = []
try:
# 找到所有数据
data = self.find_all()
# 通过字段名找到字段下标
colu_index = self.title.index(field_name.strip())
for ji in enumerate(data[1:]):
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 140 2019-08-29 15:20 Fitness_room\data\Check_fitness_facilities.csv
文件 161 2019-08-29 18:37 Fitness_room\data\class.csv
文件 791 2019-08-29 15:26 Fitness_room\data\course.csv
文件 23 2019-08-29 18:37 Fitness_room\data\is_pay.csv
文件 662 2019-08-29 18:37 Fitness_room\data\userinfo.csv
文件 22644 2019-08-31 14:11 Fitness_room\Models.py
文件 1069 2019-08-29 11:56 Fitness_room\Settings.py
文件 209 2019-08-29 16:57 Fitness_room\test.py
文件 2579 2019-08-25 19:01 Fitness_room\unit.py
文件 15666 2019-08-29 16:53 Fitness_room\views.py
文件 21524 2019-09-15 10:50 Fitness_room\__pycache__\Models.cpython-36.pyc
文件 709 2019-08-29 14:47 Fitness_room\__pycache__\Settings.cpython-36.pyc
文件 2860 2019-08-29 14:47 Fitness_room\__pycache__\unit.cpython-36.pyc
文件 10985 2019-08-29 16:53 Fitness_room\__pycache__\views.cpython-36.pyc
目录 0 2019-08-29 16:59 Fitness_room\data
目录 0 2019-09-15 10:50 Fitness_room\__pycache__
目录 0 2019-08-31 14:11 Fitness_room
----------- --------- ---------- ----- ----
80022 17
相关资源
- 酒店管理系统基于Qt Creator5)
- 设备管理系统源码
- Python全栈学习笔记面向对象大作业:
- 一个超简单的企业管理系统(带ACCE
- PowerBuilder*图书馆管理系统*需求分析
- 数据库课设:图书管理系统报告
- 用汇编实现的学生成绩档案管理系统
- 教室管理系统.rar
- 基于MVC模式的会员管理系统
- 学生信息管理系统源码
- about 论坛信息管理系统
- 合同管理系统的源代码(附数据库)
- 保险公司管理系统(前台界面)
- Pb开发的酒店住宿管理系统
- ado数据库MFC图书管理系统vs2010
- 村居人口信息管理系统
- 数据库VFP课程设计
- 完整版家庭在线记账理财管理系统
- GUI银行管理系统
- 服装店进销存管理系统
- 数据库实现学生成绩管理系统选课管
- 课程作业:模拟仓库管理系统
- 教务管理系统需求分析(全集)
- 007出纳管理系统 v7[1].5.94 算法注册机
- c 课程设计 职工信息管理系统
- 书店销售管理系统 包附源代码
- 兔子养殖场管理系统
- 通用后台管理系统模板
- 软件工程 考勤管理系统分析与设计
- 波奇宠物商品商城管理系统
评论
共有 条评论