public LanguageDetailInput Add(LanguageDetailInput input) { LanguageDetail entity = mapper.Map <LanguageDetail>(input); entity.CreatedBy = GetCurrentUserLogin(); entity.CreatedDate = DateTime.Now; entity.ModifiedDate = DateTime.Now; entity.ModifiedBy = GetCurrentUserLogin(); languageDetailRepository.Add(entity); return(mapper.Map <LanguageDetailInput>(entity)); }
public bool Update(LanguageDetailInput input) { LanguageDetail entity = GetById(input); if (entity == null) { return(false); } mapper.Map(input, entity); entity.ModifiedDate = DateTime.Now; entity.ModifiedBy = GetCurrentUserLogin(); languageDetailRepository.Update(entity); return(true); }
public IActionResult InputPartial(LanguageDetailInput inputModel) { if (inputModel.Id > 0) { //update Entities.LanguageDetail lastInfo = languageDetailService.GetById(inputModel); if (lastInfo.UpdateToken.GetValueOrDefault(Guid.Empty).Equals(inputModel.UpdateToken)) { languageProviderService.UpdateLanguage(lastInfo.LanguageCode, lastInfo.LanguageKey, inputModel.LanguageValue); return(Ok(new { result = ConstantConfig.WebApiStatusCode.Success, message = GetLang(ConstantConfig.WebApiResultMessage.UpdateSuccess) })); } return(Ok(new { result = ConstantConfig.WebApiStatusCode.Warning, message = GetLang(ConstantConfig.WebApiResultMessage.UpdateTokenNotMatch) })); } return(Ok(new { result = ConstantConfig.WebApiStatusCode.Error, message = GetLang(ConstantConfig.WebApiResultMessage.Error) })); }
public IActionResult InputPartial(EntityId <int> idModel = null) { LanguageDetailInput input = null; if (idModel == null) { input = new LanguageDetailInput(); } else { input = languageDetailService.GetInputById(idModel); } return(PartialView(input)); }