Esempio n. 1
0
        private void processData(IEnumerable <Specification> specifications, DataOP op, ProjectBrief project)
        {
            if (specifications == null)
            {
                return;
            }



            foreach (var specification in specifications)
            {
                specification.ProjectBriefId = project.Id;
                if (DataOP.AddNew == op)
                {
                    _specificationRepository.Add(specification);
                }
                else if (DataOP.EDIT == op)
                {
                    specification.Item = null;
                    _specificationRepository.Update(specification);
                }
                else if (DataOP.DEL == op)
                {
                    var requestItem = _specificationRepository.GetById(specification.Id);
                    _specificationRepository.Delete(requestItem);
                }
            }
        }