Exemplo n.º 1
0
 private ProductTypeModel TypeToModel(ProductType type)
 {
     return new ProductTypeModel { TypeId = type.Id, Name = StringUtilities.EscapeStringForDatabase(type.Name) };
 }
Exemplo n.º 2
0
 public async Task<long> RenameProductType(ProductType pType, string newProductTypeName)
 {
     pType.Name = newProductTypeName;
     var result = await DBService.SaveProductType(TypeToModel(pType)).ConfigureAwait(false);
     if (result > 0)
     {
         TypeUpdated();
     }
     return result;
 }
Exemplo n.º 3
0
 public async Task<long> SaveProductType(ProductType productType)
 {
     ProductTypesCache.SetNeedRefresh();
     var result = await DBService.SaveProductType(TypeToModel(productType)).ConfigureAwait(false);
     if (result > 0)
     {
         TypeUpdated();
     }
     return result;
 }
Exemplo n.º 4
0
 public async Task<bool> RemoveProductType(ProductType pType)
 {
     var result = await DBService.DeleteProductType(TypeToModel(pType)).ConfigureAwait(false);
     if (result)
     {
         TypeUpdated();
     }
     return result;
 }
Exemplo n.º 5
0
 private ProductTypeModel TypeToModel(ProductType type)
 {
     return(new ProductTypeModel {
         TypeId = type.Id, Name = StringUtilities.EscapeStringForDatabase(type.Name)
     });
 }