コード例 #1
0
        public Task <bool> UpdateAsyncByID(ResourcesTranslation entity)
        {
            return(Task.Run <bool>(() =>
            {
                var curr_entity = resourcesTranslationRepo.GetByID(entity.ID);

                ResourcesTranslation resourcesTranslation = new ResourcesTranslation
                {
                    ID = curr_entity.ID,
                    LanguageID = curr_entity.LanguageID,
                    ResourcesID = curr_entity.ResourcesID,
                    FieldName = curr_entity.FieldName,
                    ARDescription = curr_entity.ARDescription,
                    LatDescription = curr_entity.LatDescription,
                    Position = curr_entity.Position,
                    DisplayORNot = entity.DisplayORNot,
                    ValidationSymbole = curr_entity.ValidationSymbole,
                    ARValidationMessage = (!string.IsNullOrEmpty(entity.ARValidationMessage)) ? entity.ARValidationMessage : curr_entity.ARValidationMessage,
                    LatValidationMessage = curr_entity.LatValidationMessage,
                    ARGridColumnText = (!string.IsNullOrEmpty(entity.ARGridColumnText)) ? entity.ARGridColumnText : curr_entity.ARGridColumnText,
                    LatGridColumnText = (!string.IsNullOrEmpty(entity.LatGridColumnText)) ? entity.LatGridColumnText : curr_entity.LatGridColumnText,
                    GridColumnHeader = curr_entity.GridColumnHeader,
                    GridColumnWidth = curr_entity.GridColumnWidth,
                    GridColumnHeight = curr_entity.GridColumnHeight,
                    ResourceGroup = curr_entity.ResourceGroup,
                    Notes = curr_entity.Notes,
                    ARPlaceholderText = (!string.IsNullOrEmpty(entity.ARPlaceholderText)) ? entity.ARPlaceholderText : curr_entity.ARPlaceholderText,
                    LatPlaceholderText = (!string.IsNullOrEmpty(entity.LatPlaceholderText)) ? entity.LatPlaceholderText : curr_entity.LatPlaceholderText,
                    IsRequired = entity.IsRequired,
                    InputDataType = entity.InputDataType
                };
                resourcesTranslationRepo.Update(resourcesTranslation, resourcesTranslation.ID);
                return true;
            }));
        }
コード例 #2
0
 public Task <bool> UpdateAsync(ResourcesTranslation entity)
 {
     return(Task.Run <bool>(() =>
     {
         ResourcesTranslation resourcesTranslation = new ResourcesTranslation
         {
             ID = entity.ID,
             LanguageID = entity.LanguageID,
             ResourcesID = entity.ResourcesID,
             FieldName = entity.FieldName,
             ARDescription = entity.ARDescription,
             LatDescription = entity.LatDescription,
             Position = entity.Position,
             DisplayORNot = entity.DisplayORNot,
             ValidationSymbole = entity.ValidationSymbole,
             ARValidationMessage = entity.ARValidationMessage,
             LatValidationMessage = entity.LatValidationMessage,
             ARGridColumnText = entity.ARGridColumnText,
             LatGridColumnText = entity.LatGridColumnText,
             GridColumnHeader = entity.GridColumnHeader,
             GridColumnWidth = entity.GridColumnWidth,
             GridColumnHeight = entity.GridColumnHeight,
             ResourceGroup = entity.ResourceGroup,
             Notes = entity.Notes,
             ARPlaceholderText = entity.ARPlaceholderText,
             LatPlaceholderText = entity.LatPlaceholderText
         };
         resourcesTranslationRepo.Update(resourcesTranslation, resourcesTranslation.ID);
         return true;
     }));
 }
コード例 #3
0
        public async Task <IHttpActionResult> update([FromBody] ResourcesTranslation entity)
        {
            HttpRuntime.Cache.Remove("resourcesTranslation");

            var item = resourcesTranslationService.GetByID(2438);

            item.Notes = "test test test";

            return(Ok(await resourcesTranslationService.UpdateAsync(item)));
        }
コード例 #4
0
 public bool Update(ResourcesTranslation entity)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
 public Task <bool> InsertAsync(ResourcesTranslation entity)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public Task <bool> DeleteAsync(ResourcesTranslation customer)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
        public async Task <IHttpActionResult> updateById([FromBody] ResourcesTranslation entity)
        {
            HttpRuntime.Cache.Remove("resourcesTranslation");

            return(Ok(await resourcesTranslationService.UpdateAsyncByID(entity)));
        }