public static int SystemUserInsert(SystemUserEntity entity) { int result = RestClient.Post<int>("SystemUserService/SystemUserInsert", entity); if (result > 0) EmailHelper.SendEmail(entity.Email, entity.Password); return result; }
public int Submit(SystemUserEntity obj) { obj.InDate = DateTime.Now; obj.InUser = WebContext.LoginUser.UserName; obj.Status = 0; return SystemUserFacade.SystemUserUpdate(obj); }
/// <summary> /// 登陆 /// </summary> /// <param name="entity"></param> /// <returns></returns> public SystemUserEntity Login(SystemUserEntity entity) { DataCommand command = DataCommandManager.GetDataCommand("MySql_Login"); command.SetParameterValue("@UserName", entity.UserName); command.SetParameterValue("@Password", entity.Password); SystemUserEntity result = command.ExecuteEntity<SystemUserEntity>(); return result; }
public int Create(SystemUserEntity obj) { obj.InDate = DateTime.Now; obj.InUser = WebContext.LoginUser.UserName; obj.Status = 0; obj.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(obj.Password, "MD5"); return SystemUserFacade.SystemUserInsert(obj); }
public int SystemUserInsert(SystemUserEntity entity) { //检查用户是否存在 SystemUserEntity cheEntity = ObjectFactory<ISystemUserDataAccess>.Instance.ByUserNameGetInfo(entity.UserName); if (cheEntity == null || cheEntity.SysNo == 0) { return ObjectFactory<ISystemUserDataAccess>.Instance.SystemUserInsert(entity); } return 0; }
public static bool Login(SystemUserEntity entity) { SystemUserEntity resultEntity = RestClient.Post<SystemUserEntity>("SystemUserService/Login", entity); if (resultEntity == null || resultEntity.SysNo == 0) { return false; } else { AuthUserEntity login = new AuthUserEntity(); login.UserName = resultEntity.UserName; login.SysNo = resultEntity.SysNo; login.Email = resultEntity.Email; WebContext.Login(login); return true; } }
public string Loging(string loginName,string pwd) { SystemUserEntity entity = new SystemUserEntity() { UserName = loginName, Password = pwd, LastLoginDate = DateTime.Now }; CookieManager.SetObject("HenryProjectLoginUserName", loginName); if (SystemUserFacade.Login(entity)) { return "{\"Code\": \"OK\"," + "\"Return\": \"" + BuildUrl(PageAlias.SystemUser) + "\"}"; } else { return "{\"Code\": \"NO\"," + "\"Message\": \"登陆失败.用户名或密码错误!\"}"; } }
public int UpdatePasswordMethod(SystemUserEntity entity) { SystemUserEntity resultEntity = SystemUserFacade.LoadEntity(WebContext.LoginUser.SysNo); if (resultEntity != null && resultEntity.SysNo > 0) { string oldPassword = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(entity.OldPassword, "MD5"); if (oldPassword == resultEntity.Password) { entity.SysNo = WebContext.LoginUser.SysNo; entity.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(entity.Password, "MD5"); return SystemUserFacade.UpdatePassword(entity); } else return 0; } else return 0; }
public string Register(string newLogin, string email) { SystemUserEntity entity = new SystemUserEntity() { //Email = email + "@hearst.com.cn", UserName = newLogin, Email = email, Password = "******", LastLoginDate = DateTime.Now, Role = new List<SystemUser_RoleEntity>(), Privilege = new List<SystemUser_PrivilegeEntity>(), Status = 0, InUser = "******", InDate = DateTime.Now }; if (SystemUserFacade.SystemUserInsert(entity) > 0) { return "{\"Code\": \"OK\"," + "\"Message\": \"发送成功,请注意接收邮箱!\"}"; } else { return "{\"Code\": \"NO\"," + "\"Message\": \"请勿重复注册!\"}"; } }
public int UpdatePassword(SystemUserEntity entity) { return ObjectFactory<ISystemUserDataAccess>.Instance.UpdatePassword(entity); }
public static int SystemUserUpdate(SystemUserEntity entity) { return RestClient.Post<int>("SystemUserService/SystemUserUpdate", entity); }
public static int UpdatePassword(SystemUserEntity entity) { return RestClient.Post<int>("SystemUserService/UpdatePassword", entity); }
public int UpdatePassword(SystemUserEntity entity) { throw new NotImplementedException(); }
public int SystemUserUpdate(SystemUserEntity entity) { throw new NotImplementedException(); }
/// <summary> /// 更新用户信息 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int SystemUserUpdate(SystemUserEntity entity) { ClearSystemUser_RoleMapping(entity.SysNo); foreach (var item in entity.Role) { InsertSystemUser_RoleMapping(entity.SysNo, item.SysNo, entity.InUser); } return 1; }
/// <summary> /// 修改密码 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int UpdatePassword(SystemUserEntity entity) { DataCommand command = DataCommandManager.GetDataCommand("UpdatePassword"); command.SetParameterValue("@SysNo", entity.SysNo); command.SetParameterValue("@Password", entity.Password); return command.ExecuteNonQuery(); }
/// <summary> /// 添加系统用户 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int SystemUserInsert(SystemUserEntity entity) { DataCommand command = DataCommandManager.GetDataCommand("SystemUserInsert"); command.SetParameterValue<SystemUserEntity>(entity); int result = Convert.ToInt32(command.ExecuteScalar()); foreach (var item in entity.Role) { InsertSystemUser_RoleMapping(result, item.SysNo, entity.InUser); } return result; }
/// <summary> /// 登陆 /// </summary> /// <param name="entity"></param> /// <returns></returns> public SystemUserEntity Login(SystemUserEntity entity) { DataCommand command = DataCommandManager.GetDataCommand("Access_Login"); command.SetParameterValue("@UserName", entity.UserName); command.SetParameterValue("@Password", entity.Password); SystemUserEntity result = command.ExecuteEntity<SystemUserEntity>(); if (result != null && result.SysNo > 0) { result.Privilege = GetSystemUserPrivilege(result.SysNo); } return result; }
/// <summary> /// 修改密码 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int UpdatePassword(SystemUserEntity entity) { CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("UpdatePassword"); command.SetParameterValue("@SysNo", entity.SysNo); command.SetParameterValue("@Password", entity.Password); return command.ExecuteNonQuery(); }
public int SystemUserUpdate(SystemUserEntity entity) { return ObjectFactory<ISystemUserDataAccess>.Instance.SystemUserUpdate(entity); }
public SystemUserEntity Login(SystemUserEntity entity) { return ObjectFactory<ISystemUserDataAccess>.Instance.Login(entity); ; }