Asp.net源码专业站
首页->学教实践->在线考试系统完整版源码(C#&Access)>>ExamBLL/Auto Generated Code/UserManager.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:在线考试系统完整版源码(C#&Access)
当前文件:文件类型 ExamOnlineAccess/ExamBLL/Auto Generated Code/UserManager.cs[3K,2009-6-12 11:42:06]打开代码结构图
普通视图
		            
1using System; 2using System.Collections.Generic; 3using System.Text; 4using ExamModel.Auto_Generated_Code; 5using ExamDAL.Auto_Generated_Code; 6 7namespace ExamBLL.Auto_Generated_Code 8{ 9 public class UserManager 10 { 11 12 13 //登录 14 public static int Login(string loginId, string loginPwd,int roleid, out User validUser) 15 { 16 User user = UserServices.GetUserByLoginId(loginId); 17 18 if (user == null) 19 { 20 //用户名不存在 21 validUser = null; 22 return 0; //0表用户为空 23 } 24 if (user.UPassWord == loginPwd) 25 { 26 if (user.URole.RoleID == roleid) 27 { 28 if (user.URole.RoleID == 2) 29 { 30 validUser = user; 31 return 5; 32 } 33 else 34 { 35 validUser = user; 36 return 1; //1表成功 37 } 38 39 } 40 else 41 { 42 validUser = null; 43 return 2; //2该用户没有该权限 44 } 45 46 } 47 else 48 { 49 //密码错误 50 validUser = null; 51 return 3; //3密码不正确 52 } 53 } 54 55 56 57 58 59 60 61 62 63 64 /// <summary> 65 /// 注册新用户 66 /// </summary> 67 /// <param name="user"></param> 68 /// <returns></returns> 69 public static bool Register(User user) 70 { 71 int count=UserServices.AddUser(user); 72 if (count>0) 73 { 74 return true; 75 } 76 else 77 { 78 return false; 79 } 80 } 81 //获得所有用户 82 public static IList<User> GetAllUser() 83 { 84 return UserServices.GetAllUser(); 85 } 86 //更新科目 87 public static void ModifyUser(int UID, string UPassWord,string UserName,bool USex,string UAddress,string UPhone,string UEmail) 88 { 89 90 //Course course = CourseService.GetCourseById(CID); 91 //course.CName = CName; 92 //CourseService.ModifyCourse(course); 93 94 } 95 //通过ID获得user对象 96 //通过ID获得科目对象 97 public static User GetUserById(int userId) 98 { 99 return UserServices.GetUserById(userId); 100 } 101 //通过学号获得用户对象 102 public static User GetUserByuserid(string userId) 103 { 104 return UserServices.GetUserByuserId(userId); 105 } 106 //更新单选题 107 public static bool UpdateUser(User user) 108 { 109 if (UserServices.UpdateUser(user)) 110 { 111 return true; 112 } 113 else 114 { 115 return false; 116 } 117 118 } 119 } 120} 121
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:在线考试系统完整版源码(C#&Access)
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146