如何停用用户帐户 [英] How to deactivate the user account
本文介绍了如何停用用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
In my project i need to inactive the users when their subscription plan gets expired. How can I achieve this? Any idea on this?
For Example User 1's Plan is for 6 months Started from Started on:6/6/2012 after 6 months 6/12/2012 i need to[B] inactive [/B] this user.
推荐答案
您可以使用以下代码了解用户的帐户是否已过期?
Hi,
You can use the following code to know whether the user''s account has expired or not?
DateTime createddate = Convert.ToDateTime(createddate);
DateTime currenctdate = DateTime.Now;
TimeSpan t = currenctdate.Subtract(createddate);
int numberofdays = Convert.ToInt32(t.TotalDays);
if (numberofdays <= howmanydays(month store at days))
{
}
我已经创建了以这种方式触发...现在我怎样才能通过运行应用程序来查看我的结果...
[代码]创建触发器tr_InactiveUsers
on aspnet_membership >
for insert
as
begin
update asp_mem
set
IsApproved =''0''
来自
aspnet_membership asp_mem
加入
planmapping pm >
on
pm.accountexpiry = getdate()
end [/ CODE]
它是否正确?如果不是请请帮助...相应..
我有一个aspnetmembership一个表并计划映射另一个表格基于计划映射表上的acccountexpiry的值我需要在aspnet_membership中更新IsApproved =''1''表...
我希望它清除...
Hi i have created my Trigger in this way...now how can i able to view my results by running application...
[CODE]create trigger tr_InactiveUsers
on aspnet_membership
for insert
as
begin
update asp_mem
set
IsApproved=''0''
from
aspnet_membership asp_mem
join
planmapping pm
on
pm.accountexpiry=getdate()
end[/CODE]
Is this Correct? if not please help it...accordingly..
I have aspnetmembership one table and planmapping another table base on the value of acccountexpiry on planmapping table i need to update IsApproved=''1'' in aspnet_membership table...
I hope it clears...
您好,
每次登录都会检查创建的订阅计划日期和当前日期
用当前日期减去创建日期并检查月份
Hi,
Each and every login check the subscription plan with created date & current date
subtract the created date with current date and check the month
这篇关于如何停用用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文