예제 #1
0
        protected override void Validate(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
        {
            if (StateName.Trim() == "")
            {
                validationErrors.Add("The state name is required.");
            }
            else
            {
                ////The windows account name must be unique.
                if (new ENTWFStateData().IsDuplicateStateName(db, ID, StateName))
                {
                    validationErrors.Add("The state name must be unique.");
                }
            }

            if (ENTWorkflowId == 0)
            {
                validationErrors.Add("Please select a workflow to associate with this state.");
            }

            if ((ENTWFOwnerGroupId == 0) && (IsOwnerSubmitter == false))
            {
                validationErrors.Add("Please select the group that owns the issue while in this state.");
            }
        }