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); }
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); }
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)); }
public int EditClassification(BusinessFieldClassification entity) { _context.SbEdit(entity); return(_context.SaveChanges()); }