/// <summary> /// 登录 /// </summary> /// <param name="account">帐号</param> /// <param name="password">密码</param> /// <returns>用户</returns> public User Login(string account, string password) { User result = null; UserHibernate hibernate = new UserHibernate(); User user = hibernate.SelectByAccount(account); if (user != null) { if ((user.Password == password) && (user.Validity)) { result = user; user.Authentication = true; } } else { int count = hibernate.Count(); if (count == 0) { result = new User(); result.Guid = "Prerogative"; result.Prerogative = true; result.Authentication = true; } } if ((result != null) && (result.Authentication)) { this.Refresh(result); } return result; }
public bool Delete(User value) { bool result = false; UserHibernate hibernate = new UserHibernate(); result = hibernate.Delete(value); return result; }
/// <summary> /// 增加 /// </summary> /// <param name="value">值</param> /// <returns>结果</returns> public bool Insert(User value) { bool result = false; UserHibernate hibernate = new UserHibernate(); result = hibernate.Insert(value); return result; }
public bool ChangePassword(string guid, string password) { bool result = false; UserHibernate hibernate = new UserHibernate(); result = hibernate.ChangePassword(guid, password); return result; }
public List<User> QueryByInsertUser(User value) { List<User> results = null; UserHibernate hibernate = new UserHibernate(); results = hibernate.QueryByInsertUser(value.Guid); return results; }
public User QueryByGuid(string guid) { User result = null; UserHibernate hibernate = new UserHibernate(); result = hibernate.QueryByGuid(guid); return result; }
public User QueryByAccount(string account) { User result = null; UserHibernate hibernate = new UserHibernate(); result = hibernate.SelectByAccount(account); return result; }
/// <summary> /// 分页查询 /// </summary> /// <param name="page">页码</param> /// <param name="rows">每页行数</param> /// <param name="total">总数</param> /// <returns>用户集合</returns> public List<User> Query(int page, int rows, ref int total) { List<User> results = new List<User>(); UserHibernate hibernate = new UserHibernate(); results = hibernate.Query(page, rows, ref total); return results; }