public PunchCategory BizAction(PunchCategoryDto inputData)
        {
            if (string.IsNullOrWhiteSpace(inputData.Name))
            {
                AddError("Punch Category Name is Required.");
                return(null);
            }

            var desStatus = PunchCategory.CreatePunchCategory(inputData.Name, inputData.ProjectId);

            CombineErrors(desStatus);

            if (!HasErrors)
            {
                _dbAccess.Add(desStatus.Result);
            }

            return(HasErrors ? null : desStatus.Result);
        }
 public void Delete(PunchCategory punchCategory)
 {
     _context.PunchCategories.Remove(punchCategory);
 }
示例#3
0
 public void Add(PunchCategory punchCategory)
 {
     _context.PunchCategories.Add(punchCategory);
 }