Exemple #1
0
 private ProductSubTypeModel SubTypeToModel(ProductSubType subType)
 {
     if (subType == null)
     {
         return(null);
     }
     return(new ProductSubTypeModel {
         Id = subType.Id, Name = StringUtilities.EscapeStringForDatabase(subType.Name), TypeId = subType.TypeId
     });
 }
Exemple #2
0
        public async Task <bool> RemoveProductSubType(ProductSubType pSubType)
        {
            ProductSubTypesCache.SetNeedRefresh();
            var result = await DBService.DeleteProductSubType(SubTypeToModel(pSubType)).ConfigureAwait(false);

            if (result)
            {
                SubTypeUpdated(pSubType.TypeId);
            }
            return(result);
        }
Exemple #3
0
        public async Task <long> SaveProductSubType(ProductSubType productSubType)
        {
            ProductSubTypesCache.SetNeedRefresh();
            var result = await DBService.SaveProductSubType(SubTypeToModel(productSubType)).ConfigureAwait(false);

            if (result > 0)
            {
                SubTypeUpdated(productSubType.TypeId);
            }
            return(result);
        }
 private ProductSubTypeModel SubTypeToModel(ProductSubType subType)
 {
     if (subType == null)
     {
         return null;
     }
     return new ProductSubTypeModel { Id = subType.Id, Name = StringUtilities.EscapeStringForDatabase(subType.Name), TypeId = subType.TypeId };
 }
 public async Task<bool> RemoveProductSubType(ProductSubType pSubType)
 {
     ProductSubTypesCache.SetNeedRefresh();
     var result = await DBService.DeleteProductSubType(SubTypeToModel(pSubType)).ConfigureAwait(false);
     if (result)
     {
         SubTypeUpdated(pSubType.TypeId);
     }
     return result;
 }
 public async Task<long> SaveProductSubType(ProductSubType productSubType)
 {
     ProductSubTypesCache.SetNeedRefresh();
     var result = await DBService.SaveProductSubType(SubTypeToModel(productSubType)).ConfigureAwait(false);
     if (result > 0)
     {
         SubTypeUpdated(productSubType.TypeId);
     }
     return result;
 }