/// <summary> /// Add CurrentEducationalLevel AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddCurrentEducationalLevel(CurrentEducationalLevelAddDTO currentEducationalLevelAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (currentEducationalLevelAddDTO != null) { isCreated = await CurrentEducationalLevelBusinessMapping.AddCurrentEducationalLevel(currentEducationalLevelAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddCurrentEducationalLevel(CurrentEducationalLevelAddDTO CurrentEducationalLevelAddDTO) { #region Declare a return type with initial value. bool isCurrentEducationalLevelCreated = default(bool); #endregion try { #region Vars CurrentEducationalLevel CurrentEducationalLevel = null; #endregion CurrentEducationalLevel = CurrentEducationalLevelMapping.MappingCurrentEducationalLevelAddDTOToCurrentEducationalLevel(CurrentEducationalLevelAddDTO); if (CurrentEducationalLevel != null) { await UnitOfWork.CurrentEducationalLevelRepository.Insert(CurrentEducationalLevel); isCurrentEducationalLevelCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isCurrentEducationalLevelCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<CurrentEducationalLevel></returns> public CurrentEducationalLevel MappingCurrentEducationalLevelAddDTOToCurrentEducationalLevel(CurrentEducationalLevelAddDTO CurrentEducationalLevelAddDTO) { #region Declare a return type with initial value. CurrentEducationalLevel CurrentEducationalLevel = null; #endregion try { CurrentEducationalLevel = new CurrentEducationalLevel { CurrentEducationalLevelName = CurrentEducationalLevelAddDTO.CurrentEducationalLevelName, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(CurrentEducationalLevel); }
public async Task <ActionResult <CommonAPIResponse <bool> > > AddCurrentEducationalLevel(CurrentEducationalLevelAddDTO CurrentEducationalLevelAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddCurrentEducationalLevel for nullability before prepaing the response. if (await CurrentEducationalLevelAppService.AddCurrentEducationalLevel(CurrentEducationalLevelAddDTO)) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }