public ActionResult UpdateScratch(UpdateScratch updateScratch) { string actionBy = User.Identity.Name; _mainResponse = _exhibitorService.UpdateScratch(updateScratch, actionBy); _jsonString = Mapper.Convert <BaseResponse>(_mainResponse); return(new OkObjectResult(_jsonString)); }
public MainResponse UpdateScratch(UpdateScratch updateScratch, string actionBy) { var exhibitorClass = _exhibitorClassRepository.GetSingle(x => x.ExhibitorClassId == updateScratch.exhibitorClassId && x.IsActive == true && x.IsDeleted == false); if (exhibitorClass != null && exhibitorClass.ExhibitorClassId > 0) { exhibitorClass.IsScratch = updateScratch.IsScratch; exhibitorClass.ModifiedBy = actionBy; exhibitorClass.ModifiedDate = DateTime.Now; _exhibitorClassRepository.Update(exhibitorClass); _mainResponse.Message = Constants.CLASS_EXHIBITOR_SCRATCH; _mainResponse.Success = true; } else { _mainResponse.Message = Constants.NO_RECORD_FOUND; _mainResponse.Success = false; } return(_mainResponse); }