コード例 #1
0
 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;
 }
コード例 #2
0
 public int Submit(SystemUserEntity obj)
 {
     obj.InDate = DateTime.Now;
     obj.InUser = WebContext.LoginUser.UserName;
     obj.Status = 0;
     return SystemUserFacade.SystemUserUpdate(obj);
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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;
 }
コード例 #6
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;
     }
 }
コード例 #7
0
ファイル: Login.aspx.cs プロジェクト: ZhouHengYi/HFramework
 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\": \"登陆失败.用户名或密码错误!\"}";
     }
 }
コード例 #8
0
 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;
 }
コード例 #9
0
ファイル: Login.aspx.cs プロジェクト: ZhouHengYi/HFramework
 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\": \"请勿重复注册!\"}";
     }
 }
コード例 #10
0
 public int UpdatePassword(SystemUserEntity entity)
 {
     return ObjectFactory<ISystemUserDataAccess>.Instance.UpdatePassword(entity);
 }
コード例 #11
0
 public static int SystemUserUpdate(SystemUserEntity entity)
 {
     return RestClient.Post<int>("SystemUserService/SystemUserUpdate", entity);
 }
コード例 #12
0
 public static int UpdatePassword(SystemUserEntity entity)
 {
     return RestClient.Post<int>("SystemUserService/UpdatePassword", entity);
 }
コード例 #13
0
 public int UpdatePassword(SystemUserEntity entity)
 {
     throw new NotImplementedException();
 }
コード例 #14
0
 public int SystemUserUpdate(SystemUserEntity entity)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
 /// <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;
 }
コード例 #16
0
 /// <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();
 }
コード例 #17
0
 /// <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;
 }
コード例 #18
0
 /// <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;
 }
コード例 #19
0
 /// <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();
 }
コード例 #20
0
 public int SystemUserUpdate(SystemUserEntity entity)
 {
     return ObjectFactory<ISystemUserDataAccess>.Instance.SystemUserUpdate(entity);
 }
コード例 #21
0
 public SystemUserEntity Login(SystemUserEntity entity)
 {
     return ObjectFactory<ISystemUserDataAccess>.Instance.Login(entity); ;
 }