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