/// <summary> /// 更新用户账户状态 /// </summary> /// <param name="tenantId"></param> /// <param name="id"></param> /// <param name="state"></param> public void UpdateState(int tenantId, int id, AppUserAccountState state) { ArgumentHelper.AssertIsTrue(tenantId > 0, "tenantId is 0"); ArgumentHelper.AssertIsTrue(id > 0, "id is 0"); AppUserAccountDao.UpdateState(tenantId, id, state); }
/// <summary> /// 更新用户账户状态 /// </summary> /// <param name="tenantId"></param> /// <param name="id"></param> /// <param name="state"></param> internal static void UpdateState(int tenantId, int id, AppUserAccountState state) { var db = Database.GetDatabase(DatabaseName.UserSecurity); SafeProcedure.ExecuteNonQuery(db, "dbo.AppUserAccount_UpdateState", parameterMapper => { parameterMapper.AddWithValue("@TenantId", tenantId); parameterMapper.AddWithValue("@Id", id); parameterMapper.AddWithValue("@State", (short)state); }); }
/// <summary> /// 获取账户状态描述 /// </summary> /// <param name="state"></param> /// <returns></returns> public string GetStateName(AppUserAccountState state) { switch (state) { case AppUserAccountState.Inactive: return("未激活"); case AppUserAccountState.Activated: return("已激活"); case AppUserAccountState.Unbind: return("已解绑"); default: throw new ArgumentException("未找对应状态"); } }