Commit 9c01c978 by Neo Turing

优化

parent c587198b
......@@ -84,6 +84,20 @@ namespace Kivii.Finances.Transforms
{
}
[RequiresAnyRole(MemberRoles.Everyone)]
public class AccountUpdate : RestfulUpdate<Account>
{
}
[RequiresAnyRole(MemberRoles.Everyone)]
public class AccountDelete : RestfulDelete<Account>
{
public override bool OnPreRestfulDelete(IRequest req, IResponse res, IDbConnection dbConnection, IRestfulDeleteResponse<Account> rtns)
{
if (dbConnection.Exists<Account>(o => o.Amount > 0 && Sql.In(o.Kvid, Kvids))) throw new Exception("要删除的账户存在金额大于0,无法删除");
return base.OnPreRestfulDelete(req, res, dbConnection, rtns);
}
}
[Api(Description = "账户查询")]
[RequiresAnyRole(MemberRoles.Everyone)]
public class AccountQueryEx : RestfulExecution<Account>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment