using ProjectBase.Data.BaseDAL; using ProjectBase.Data.Encrypt; using ProjectBase.Data.Logs; using SIASUN.Autopilot.DAL.IDALSQL; using SIASUN.Autopilot.Model; using System; namespace SIASUN.Autopilot.BLL { public class BlAuthoryUser : BaseBLL { private IDalAuthoryUser dalAuthoryUser; /// /// 构造函数 /// public BlAuthoryUser() : base() { base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name); dalAuthoryUser = base.baseDal as IDalAuthoryUser; dalAuthoryUser.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog); } /// /// 登录账户和密码验证 /// /// 账户 /// 密码 /// 反馈信息 /// //public bool VerifyLogin(string userAccount, string userPasswd, out string message) //{ // try // { // message = ""; // MoAuthoryUser user = FindByID(userAccount); // if (user == null) // { // message = "不存在账号!"; // return false; // } // //string encrptPasswd = EncodeHelper.MD5Encrypt(userPasswd); // //如果该用户的密码是初始密码,让用户修改密码 // if (user.LoginPasswd.Equals(EncodeHelper.EncryptString("000000"))) // { // message = "您的密码为初始密码,请点击开始菜单修改密码!"; // return false; // } // if (userPasswd.Equals(user.LoginPasswd)) // { // SysEnvironment.CurrentLoginName = user.UserName; // SysEnvironment.CurrentLoginGroupId = user.GroupId; // //bool flag = BLLFactory.Instance.VerifyBlackWhite(user.LoginAccount,SysEnvironment.Ip,out message); // //if (!flag) // //{ // // return false; // //} // ////登录成功后记录到用户登录日志中 // //MoLogLogIn moLogIn = new MoLogLogIn // //{ // // Account = user.LoginAccount, // // Name = user.UserName, // // GroupId = user.GroupId, // // Description = "用户登录", // // Ip = SysEnvironment.Ip, // // Mac = SysEnvironment.Mac, // // Time = DateTime.Now // //}; // //if (BLLFactory.Instance.Insert(moLogIn)) // //{ // // return true; // //} // //else // //{ // // message = "记录用户登录日志失败"; // // return false; // //} // } // else // { // message = "密码错误!"; // return false; // } // } // catch (Exception ex) // { // LogHelper.log.Error(string.Format("修改数据库plc_info出现错误:{0}", ex)); // message = ex.ToString(); // return false; // } //} } }