public bool AllowWasteDisposal(WorkflowAllowApproveAndRejectInput input) { //if (input.CreatedUser != input.CurrentUser) // return false; if (!_wasteRoleServices.IsUserDisposalTeamByPlant(input.CurrentUser, input.DestPlant)) { //get delegated disposal poa var listDisposal = _wasteRoleServices.GetUserDisposalTeamByPlant(input.DestPlant); var poaDelegate = _poaDelegationServices.GetListPoaDelegateByDate(listDisposal, DateTime.Now); if (!poaDelegate.Contains(input.CurrentUser)) { return(false); } } return(input.DocumentStatus == Enums.DocumentStatus.WasteDisposal); }
private WorkflowHistoryDto CreateWaitingDisposalRecord(GetByFormNumberInput input) { var newRecord = new WorkflowHistoryDto(); newRecord.FORM_NUMBER = input.FormNumber; newRecord.ACTION = Enums.ActionType.WaitingForWasteDisposal; string displayUserId = ""; var listUserDisposal = _wasteRoleServices.GetUserDisposalTeamByPlant(input.PlantId); var poaDelegate = _poaDelegationServices.GetListPoaDelegateByDate(listUserDisposal, DateTime.Now); listUserDisposal.AddRange(poaDelegate); displayUserId = String.Join(", ", listUserDisposal.ToArray()); newRecord.ROLE = Enums.UserRole.User; newRecord.UserId = displayUserId; return(newRecord); }