public async Task <ActionResult <CommonAPIResponse <bool> > > AddGrade(GradeAddDTO GradeAddDTO) { #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <bool>(); #endregion try { #region Validate AddGrade for nullability before prepaing the response. if (await GradeAppService.AddGrade(GradeAddDTO)) { 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); }
/// <summary> /// Add Industry AppService /// </summary> /// <returns>bool<bool></returns> public async Task <bool> AddIndustry(GradeAddDTO industryAddDTO) { #region Declare a return type with initial value. bool isCreated = false; #endregion try { if (industryAddDTO != null) { isCreated = await IndustryBusinessMapping.AddIndustry(industryAddDTO); } } catch (Exception exception) {} return(isCreated); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name=></ param > /// <returns>Task<Grade></returns> public Grade MappingGradeAddDTOToGrade(GradeAddDTO GradeAddDTO) { #region Declare a return type with initial value. Grade Grade = null; #endregion try { Grade = new Grade { GradeName = GradeAddDTO.GradeName, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) { } return(Grade); }
/// <summary> /// Mapping user Action Actitvity Log /// </summary> /// <param name="></param> /// <returns>Task<Industry></returns> public Industry MappingIndustryAddDTOToIndustry(GradeAddDTO IndustryAddDTO) { #region Declare a return type with initial value. Industry Industry = null; #endregion try { Industry = new Industry { IndustryName = IndustryAddDTO.IndustryName, CreationDate = DateTime.Now, IsDeleted = (byte)DeleteStatusEnum.NotDeleted }; } catch (Exception exception) {} return(Industry); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name="></param> /// <returns>bool</returns> public async Task <bool> AddIndustry(GradeAddDTO IndustryAddDTO) { #region Declare a return type with initial value. bool isIndustryCreated = default(bool); #endregion try { #region Vars Industry Industry = null; #endregion Industry = IndustryMapping.MappingIndustryAddDTOToIndustry(IndustryAddDTO); if (Industry != null) { await UnitOfWork.IndustryRepository.Insert(Industry); isIndustryCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isIndustryCreated); }
/// <summary> /// Create User Action Activity Log /// </summary> /// <param name=></param> /// <returns>bool</returns> public async Task <bool> AddGrade(GradeAddDTO GradeAddDTO) { #region Declare a return type with initial value. bool isGradeCreated = default(bool); #endregion try { #region Vars Grade Grade = null; #endregion Grade = GradeMapping.MappingGradeAddDTOToGrade(GradeAddDTO); if (Grade != null) { await UnitOfWork.GradeRepository.Insert(Grade); isGradeCreated = await UnitOfWork.Commit() > default(int); } } catch (Exception exception) { } return(isGradeCreated); }