Esempio n. 1
0
        public bool ExistCodeClassification(BusinessFieldClassification entity)
        {
            var result = AllBusinessFieldClassification.Any(x =>
                                                            x.MainSectionCode == entity.MainSectionCode ||
                                                            x.SectionCode == entity.SectionCode ||
                                                            x.SubSectionCode == entity.SubSectionCode ||
                                                            x.GroupCode == entity.GroupCode
                                                            );

            return(result);
        }
Esempio n. 2
0
        public bool ValidCodeClassification(BusinessFieldClassification entity)
        {
            var result = AllBusinessFieldClassification.Any(x => (
                                                                x.MainSectionCode == entity.MainSectionCode ||
                                                                x.SectionCode == entity.SectionCode ||
                                                                x.SubSectionCode == entity.SubSectionCode ||
                                                                x.GroupCode == entity.GroupCode
                                                                ) && x.Id != entity.Id);

            return(result);
        }
Esempio n. 3
0
        public IActionResult PostClassification([FromBody] CreateEditClassificationViewModel model)
        {
            var enitity = new BusinessFieldClassification();

            if (model is null)
            {
                return(BadRequest("Data is null."));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            _mapper.Map(model, enitity);
            _BussinessFieldProvider.AddClassification(enitity);
            return(Ok(enitity));
        }
Esempio n. 4
0
 public int EditClassification(BusinessFieldClassification entity)
 {
     _context.SbEdit(entity);
     return(_context.SaveChanges());
 }