public static bool CanBalance(this LeaveRequest target) { return target != null && (target.State != LeaveRequestState.Completed); }
public static LeaveRequest CreateLeaveRequest(HrmContext ctx, LeaveRequest request) { request.RequestIssuerId = ctx.UserContext.Identity.Name; ctx.DbContext.LeaveRequests.Add(request); return request; }
public static (bool able, string reason) CanDeputyBy(this LeaveRequest target, string deputy) { if (target == null) return (false, "target not exist"); return (target.CanBalance(), ""); }