Пример #1
0
        public BoolResult AddProductToSocet(Data.Dto.Product product, Data.Dto.WarehouseSocet socet)
        {
            var result        = new BoolResult();
            var socetProducts = new SocetProducts(product, socet);

            result = warehouseSocetRepository.UpdateUseVolumeAndWeight(socet.Id, product.Weight, product.Volume);
            if (result.Succes)
            {
                result = socetProductRepository.Add(socetProducts);
            }
            return(result);
        }
Пример #2
0
        public BoolResult AddManyProductToSocet(Data.Dto.Product product, Data.Dto.WarehouseSocet socet, int count)
        {
            var result = new BoolResult();
            var list   = new List <SocetProducts>();

            for (int i = 0; i < count; i++)
            {
                list.Add(new SocetProducts(product, socet));
            }

            result = warehouseSocetRepository.UpdateUseVolumeAndWeight(socet.Id, product.Weight * count, product.Volume * count);
            if (result.Succes)
            {
                result = socetProductRepository.Add(list);
            }
            return(result);
        }
Пример #3
0
 public BoolResult GetManyProductFromSocet(Data.Dto.Product product, Data.Dto.WarehouseSocet socet, int count)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public BoolResult UpdateProduct(Data.Dto.Product product)
 {
     return(productRepository.Update(product));
 }
Пример #5
0
 public BoolResult AddProduct(Data.Dto.Product product)
 {
     return(productRepository.Add(product));
 }
Пример #6
0
 public static BoolResult GetManyProductTFromSocet(Data.Dto.Product product, Data.Dto.WarehouseSocet socet, int count)
 {
     return(ServiceManager.Call <SocetProductsClient, BoolResult>(c => c.GetManyProductFromSocet(product, socet, count)));
 }
Пример #7
0
 public static BoolResult AddProductToSocet(Data.Dto.Product product, Data.Dto.WarehouseSocet socet)
 {
     return(ServiceManager.Call <SocetProductsClient, BoolResult>(c => c.AddProductToSocet(product, socet)));
 }