public List <ClassInfoEntity> GetSearch(string keyString, string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from ClassInfo(nolock) where valid = 'T' and (code like '%{0}%' or name like '%{0}%')", keyString); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize, pageSize, out pageCount, out total); List <ClassInfoEntity> list = new List <ClassInfoEntity>(); foreach (DataRow dr in dt.Rows) { ClassInfoEntity entity = new ClassInfoEntity(); entity.ClassID = Ext.ToInt(dr["ClassID"]); entity.Code = Ext.ToString(dr["Code"]); entity.Name = Ext.ToString(dr["Name"]); entity.Type = Ext.ToString(dr["Type"]); entity.StartTime = Ext.ToDateOrNull(dr["StartTime"]); entity.EndTime = Ext.ToDateOrNull(dr["EndTime"]); entity.TeacherID = Ext.ToIntOrNull(dr["TeacherID"]); entity.Company = Ext.ToString(dr["Company"]); entity.Department = Ext.ToString(dr["Department"]); entity.Remark = Ext.ToString(dr["Remark"]); entity.Valid = Ext.ToString(dr["Valid"]); entity.CreateTime = Ext.ToDate(dr["CreateTime"]); entity.CreateBy = Ext.ToString(dr["CreateBy"]); entity.UpdateTime = Ext.ToDate(dr["UpdateTime"]); entity.UpdateBy = Ext.ToString(dr["UpdateBy"]); list.Add(entity); } return(list); }
public List <SchoolInfoEntity> GetSearch(string keyString, string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from SchoolInfo(nolock) where valid = 'T' and (code like '%{0}%' or name like '%{0}%')", keyString); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize, pageSize, out pageCount, out total); List <SchoolInfoEntity> list = new List <SchoolInfoEntity>(); foreach (DataRow dr in dt.Rows) { SchoolInfoEntity entity = new SchoolInfoEntity(); entity.ID = Ext.ToInt(dr["ID"]); entity.Code = Ext.ToString(dr["Code"]); entity.Name = Ext.ToString(dr["Name"]); entity.Address = Ext.ToString(dr["Address"]); entity.Description = Ext.ToString(dr["Description"]); entity.Remark = Ext.ToString(dr["Remark"]); entity.Company = Ext.ToString(dr["Company"]); entity.Valid = Ext.ToString(dr["Valid"]); entity.CreateTime = Ext.ToDate(dr["CreateTime"]); entity.CreateBy = Ext.ToString(dr["CreateBy"]); entity.UpdateTime = Ext.ToDate(dr["UpdateTime"]); entity.UpdateBy = Ext.ToString(dr["UpdateBy"]); list.Add(entity); } return(list); }
public List <ArrangeClassEntity> GetSearch(string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from ArrangeClass(nolock) where valid = 'T'"); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize, pageSize, out pageCount, out total); List <ArrangeClassEntity> list = new List <ArrangeClassEntity>(); foreach (DataRow dr in dt.Rows) { ArrangeClassEntity entity = new ArrangeClassEntity(); entity.ID = Ext.ToInt(dr["ID"]); entity.CurriculumID = Ext.ToInt(dr["CurriculumID"]); entity.ClassID = Ext.ToInt(dr["ClassID"]); entity.ClassRoomID = Ext.ToInt(dr["ClassRoomID"]); entity.TeacherID = Ext.ToInt(dr["TeacherID"]); entity.StartTime = Ext.ToDateOrNull(dr["StartTime"]); entity.EndTime = Ext.ToDateOrNull(dr["EndTime"]); entity.Remark = Ext.ToString(dr["Remark"]); entity.BespeakCount = Ext.ToIntOrNull(dr["BespeakCount"]); entity.AttendCount = Ext.ToIntOrNull(dr["AttendCount"]); entity.PassedCount = Ext.ToIntOrNull(dr["PassedCount"]); entity.Valid = Ext.ToString(dr["Valid"]); entity.CreateTime = Ext.ToDate(dr["CreateTime"]); entity.CreateBy = Ext.ToString(dr["CreateBy"]); entity.UpdateTime = Ext.ToDate(dr["UpdateTime"]); entity.UpdateBy = Ext.ToString(dr["UpdateBy"]); list.Add(entity); } return(list); }
public List <ClassStudentMapViewEntity> GetSearch(int?classID, string keyString, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format(@"select cs.ID, c.ClassID, c.Code as 'ClassCode', c.Name as 'ClassName', u.ID as 'StudentID', u.Code as 'StudentCode', u.Name as 'StudentName' from ClassStudentMap(nolock) cs inner join UserInfo(nolock) u on u.ID = cs.StudentID and u.valid = 'T' inner join ClassInfo(nolock) c on c.ClassID = cs.ClassID and c.valid = 'T' where cs.valid = 'T' {1} and (c.Code like '%{0}%' or c.Name like '%{0}%' or u.Code like '%{0}%' or u.Name like '%{0}%') ", keyString, classID == null ? "" : " and cs.ClassID = " + classID); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by cs.ClassID {0}", order), null, offset / pageSize, pageSize, out pageCount, out total); List <ClassStudentMapViewEntity> list = new List <ClassStudentMapViewEntity>(); foreach (DataRow dr in dt.Rows) { ClassStudentMapViewEntity entity = new ClassStudentMapViewEntity(); entity.ID = Ext.ToInt(dr["ID"]); entity.ClassID = Ext.ToInt(dr["ClassID"]); entity.ClassCode = Ext.ToString(dr["ClassCode"]); entity.ClassName = Ext.ToString(dr["ClassName"]); entity.StudentID = Ext.ToInt(dr["StudentID"]); entity.StudentCode = Ext.ToString(dr["StudentCode"]); entity.StudentName = Ext.ToString(dr["StudentName"]); list.Add(entity); } return(list); }
public List <LoginLogEntity> GetSearch(string whereCondition, string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from LoginLog(nolock) {0}", whereCondition); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize, pageSize, out pageCount, out total); List <LoginLogEntity> list = new List <LoginLogEntity>(); foreach (DataRow dr in dt.Rows) { LoginLogEntity entity = new LoginLogEntity(); entity.ID = Ext.ToInt(dr["ID"]); entity.Guid = Ext.ToString(dr["Guid"]); entity.Type = Ext.ToString(dr["Type"]); entity.LoginID = Ext.ToInt(dr["LoginName"]); entity.LoginName = Ext.ToString(dr["LoginName"]); entity.LoginType = Ext.ToString(dr["LoginType"]); entity.Action = Ext.ToString(dr["Action"]); entity.TimeRecord = Ext.ToDateOrNull(dr["TimeRecord"]); entity.Remark = Ext.ToString(dr["Remark"]); entity.MachineID = Ext.ToString(dr["MachineID"]); entity.LoginIP = Ext.ToString(dr["LoginIP"]); entity.LoginIP2 = Ext.ToString(dr["LoginIP2"]); entity.StartTime = Ext.ToDateOrNull(dr["StartTime"]); entity.EndTime = Ext.ToDateOrNull(dr["EndTime"]); entity.CreateTime = Ext.ToDate(dr["CreateTime"]); entity.UpdateTime = Ext.ToDate(dr["UpdateTime"]); list.Add(entity); } return(list); }
public List <StudentClassHistoryEntity> GetSearch(string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from StudentClassHistory(nolock) where valid = 'T'"); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize, pageSize, out pageCount, out total); List <StudentClassHistoryEntity> list = new List <StudentClassHistoryEntity>(); foreach (DataRow dr in dt.Rows) { StudentClassHistoryEntity entity = new StudentClassHistoryEntity(); entity.ID = Ext.ToInt(dr["ID"]); entity.StudentID = Ext.ToInt(dr["StudentID"]); entity.ArrangeClassID = Ext.ToInt(dr["ArrangeClassID"]); entity.StartTime = Ext.ToDateOrNull(dr["StartTime"]); entity.EndTime = Ext.ToDateOrNull(dr["EndTime"]); entity.Score = Ext.ToIntOrNull(dr["Score"]); entity.IsAttend = Ext.ToString(dr["IsAttend"]); entity.IsPass = Ext.ToString(dr["IsPass"]); entity.Remark = Ext.ToString(dr["Remark"]); entity.Valid = Ext.ToString(dr["Valid"]); entity.CreateTime = Ext.ToDate(dr["CreateTime"]); entity.CreateBy = Ext.ToString(dr["CreateBy"]); entity.UpdateTime = Ext.ToDate(dr["UpdateTime"]); entity.UpdateBy = Ext.ToString(dr["UpdateBy"]); list.Add(entity); } return(list); }
public List <UserInfoEntity> GetSearch(string keyString, string type, string sort, string order, int offset, int pageSize, out int total) { int pageCount = 0; string querySql = string.Format("select * from UserInfo(nolock) where valid = 'T' {1} and (code like '%{0}%' or name like '%{0}%') ", keyString, string.IsNullOrWhiteSpace(type) ? "" : string.Format(" and Type = '{0}'", type)); DataTable dt = SplitPage.SqlSplitPage(querySql, string.Format("order by {0} {1}", sort, order), null, offset / pageSize + 1, pageSize, out pageCount, out total); List <UserInfoEntity> list = new List <UserInfoEntity>(); foreach (DataRow dr in dt.Rows) { UserInfoEntity entity = new UserInfoEntity(); entity.ID = Ext.ToInt(dr["id"]); entity.Code = Ext.ToString(dr["code"]); entity.Name = Ext.ToString(dr["name"]); entity.Password = Ext.ToString(dr["password"]); entity.Type = Ext.ToString(dr["type"]); entity.Group = Ext.ToString(dr["group"]); entity.Company = Ext.ToString(dr["company"]); entity.Department = Ext.ToString(dr["department"]); entity.PositionID = Ext.ToString(dr["positionID"]); entity.PositionName = Ext.ToString(dr["positionName"]); entity.Sex = Ext.ToString(dr["sex"]); entity.Birthday = Ext.ToDate(dr["birthday"]); entity.Email = Ext.ToString(dr["email"]); entity.Phone = Ext.ToString(dr["phone"]); entity.Address = Ext.ToString(dr["address"]); entity.Valid = Ext.ToString(dr["valid"]); entity.CreateTime = Ext.ToDate(dr["createTime"]); entity.CreateBy = Ext.ToString(dr["createBy"]); entity.UpdateTime = Ext.ToDate(dr["updateTime"]); entity.UpdateBy = Ext.ToString(dr["updateBy"]); list.Add(entity); } return(list); }