You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							56 lines
						
					
					
						
							1.4 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							56 lines
						
					
					
						
							1.4 KiB
						
					
					
				| using System; | |
| using PetaPoco; | |
| 
 | |
| using Pingchuan.BeijingSafeguard.DAL; | |
| using Pingchuan.BeijingSafeguard.Model; | |
| using Pingchuan.BeijingSafeguard.Utility; | |
| 
 | |
| namespace Pingchuan.BeijingSafeguard.BLL | |
| { | |
|     public class UserBLL | |
|     { | |
|         public static User GetUser(string name,string password) | |
|         { | |
|             return UserDAL.Get(name, password); | |
|         } | |
| 
 | |
|         public static User GetUserIdByRealName(string realName) | |
|         { | |
|             return UserDAL.Get(realName); | |
|         } | |
| 
 | |
|         public static int Add(User user) | |
|         { | |
|             user.Enabled = 1; | |
|             user.ComputeCount = 0; | |
|             user.LastComputeTime = null; | |
|             user.LoginCount = 0; | |
|             user.LastLoginTime = null; | |
|             user.LoginPassword = Helper.CalcMD5(user.LoginPassword); | |
|             user.CreateTime = DateTime.Now; | |
|             return UserDAL.Add(user); | |
|         } | |
| 
 | |
|         public static int Update(User user) | |
|         { | |
|             return UserDAL.Update(user); | |
|         } | |
| 
 | |
|         public static int UpdatePassword(int id, string newPassword) | |
|         { | |
|             string md5 = Helper.CalcMD5(newPassword); | |
|             return UserDAL.UpdatePassword(id, md5); | |
|         } | |
| 
 | |
|         public static int Delete(int id) | |
|         { | |
|             return UserDAL.Delete(id); | |
|         } | |
| 
 | |
|         public static Pagination<UserDTO> Query(int orgId, int pageIndex, int pageSize) | |
|         { | |
|             return UserDAL.Query(orgId, pageIndex, pageSize); | |
|         } | |
| 
 | |
|     } | |
| } |