def loadteacher(path): data = xlstool.getdata(path, u'教师') teachdata = [] attenddata = [] logindata = [] for i in data: temp = list(i) teacherid = uuid.uuid1() teachdata.append( (temp[0], teacherid, temp[1], temp[2], temp[3], temp[4], '123456')) logindata.append( (temp[5], 'e10adc3949ba59abbe56e057f20f883e', teacherid)) sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams(config.Config.teachertable, [ 'schoolId', 'teacherId', 'teacherName', 'teacherPhone', 'offer', 'jobTitle', 'password' ], teachdata) if result: result = sqlhelp.inserttableinfo_byparams( config.Config.usertable, ['username', 'password', 'userId'], logindata) return result
def loadstudent(path): data = xlstool.getdata(path, u'学生') studentdata = [] studentattenddata = [] logindata = [] for i in data: temp = list(i) studentid = uuid.uuid1() studentdata.append( (studentid, temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6], temp[7], temp[8], temp[9], temp[10], temp[14])) studentattenddata.append((studentid, temp[11], temp[13])) logindata.append( (temp[12], 'e10adc3949ba59abbe56e057f20f883e', studentid)) sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams(config.Config.studenttable, [ 'studentId', 'name', 'sex', 'birthday', 'address', 'familyPhone', 'mail', 'family', 'admissionTime', 'nation', 'placeOfOrigin', 'team', 'id' ], studentdata) if result: result = sqlhelp.inserttableinfo_byparams( config.Config.student_attend_table, ['studentId', 'classId', 'time'], studentattenddata) if result: result = sqlhelp.inserttableinfo_byparams( config.Config.usertable, ['username', 'password', 'userId'], logindata) return result
def loadstudent(path): data=xlstool.getdata(path, u'学生') studentdata=[] studentattenddata=[] logindata=[] for i in data: temp=list(i) studentid=uuid.uuid1() studentdata.append((studentid,temp[0],temp[1],temp[2],temp[3],temp[4],temp[5],temp[6],temp[7],temp[8],temp[9],temp[10],temp[14])) studentattenddata.append((studentid,temp[11],temp[13])) logindata.append((temp[12],'e10adc3949ba59abbe56e057f20f883e',studentid)) sqlhelp=SQLTool.getObject() sqlhelp.connectdb() result=sqlhelp.inserttableinfo_byparams(config.Config.studenttable, ['studentId','name','sex','birthday','address','familyPhone','mail','family','admissionTime','nation','placeOfOrigin','team','id'], studentdata) if result: result=sqlhelp.inserttableinfo_byparams(config.Config.student_attend_table, ['studentId','classId','time'], studentattenddata) if result: result=sqlhelp.inserttableinfo_byparams(config.Config.usertable, ['username','password','userId'], logindata) return result
def loadteacher(path): data = xlstool.getdata(path, u"教师") teachdata = [] attenddata = [] logindata = [] for i in data: temp = list(i) teacherid = uuid.uuid1() teachdata.append((temp[0], teacherid, temp[1], temp[2], temp[3], temp[4], "123456")) logindata.append((temp[5], "e10adc3949ba59abbe56e057f20f883e", teacherid)) sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams( config.Config.teachertable, ["schoolId", "teacherId", "teacherName", "teacherPhone", "offer", "jobTitle", "password"], teachdata, ) if result: result = sqlhelp.inserttableinfo_byparams( config.Config.usertable, ["username", "password", "userId"], logindata ) return result
def loadschool(path): data=xlstool.getdata(path, u'学校') sqlhelp=SQLTool.getObject() sqlhelp.connectdb() result=sqlhelp.inserttableinfo_byparams(config.Config.schooltable, ['province','city','schoolName','schoolTime'], data) return result
def loadschool(path): data = xlstool.getdata(path, u'学校') sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams( config.Config.schooltable, ['province', 'city', 'schoolName', 'schoolTime'], data) return result
def loadclasstake(path): data=xlstool.getdata(path, u'上课表') classdata=[] for i in data: temp=list(i) classid=uuid.uuid1() print classid # temp.append('classid') classdata.append((temp[0],temp[1],temp[2],temp[3])) sqlhelp=SQLTool.getObject() sqlhelp.connectdb() result=sqlhelp.inserttableinfo_byparams(config.Config.teachtable, ['teacherId','classId','masterId','time'], classdata) return result
def loadclasstake(path): data = xlstool.getdata(path, u'上课表') classdata = [] for i in data: temp = list(i) classid = uuid.uuid1() print classid # temp.append('classid') classdata.append((temp[0], temp[1], temp[2], temp[3])) sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams( config.Config.teachtable, ['teacherId', 'classId', 'masterId', 'time'], classdata) return result
def loadclass(path): data=xlstool.getdata(path, u'班级') classdata=[] classnamedata=[] for i in data: temp=list(i) classid=uuid.uuid1() print classid # temp.append('classid') classdata.append((temp[0],temp[1],temp[2],classid)) classnamedata.append((temp[3],classid)) sqlhelp=SQLTool.getObject() sqlhelp.connectdb() result=sqlhelp.inserttableinfo_byparams(config.Config.classtable, ['schoolId','gradeId','cid','classId'], classdata) if result: result=sqlhelp.inserttableinfo_byparams(config.Config.classnametable, ['className','classId'], classnamedata) return result
def loadclass(path): data = xlstool.getdata(path, u'班级') classdata = [] classnamedata = [] for i in data: temp = list(i) classid = uuid.uuid1() print classid # temp.append('classid') classdata.append((temp[0], temp[1], temp[2], classid)) classnamedata.append((temp[3], classid)) sqlhelp = SQLTool.getObject() sqlhelp.connectdb() result = sqlhelp.inserttableinfo_byparams( config.Config.classtable, ['schoolId', 'gradeId', 'cid', 'classId'], classdata) if result: result = sqlhelp.inserttableinfo_byparams(config.Config.classnametable, ['className', 'classId'], classnamedata) return result