示例#1
0
        public bool CreateNewSupplierWithLinkToProductById(int prodId, string supplierName)
        {
            try
            {
                var request = new CreateSupplierWithLinkToProductRequest();
                request.ProductId    = prodId;
                request.SupplierName = supplierName;
                var response = this.Service.CreateNewSupplierWithLinkToProductById(request);
                return(response.IsCreated);
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "PL Policy"))
                {
                    throw;
                }
            }

            return(false);
        }
        public CreateSupplierWithLinkToProductResponse CreateNewSupplierWithLinkToProductById(CreateSupplierWithLinkToProductRequest request)
        {
            var bc = DependencyInjectionHelper.GetBusinessComponent <SupplierBusinessComponent>();

            var response = new CreateSupplierWithLinkToProductResponse();

            response.IsCreated = bc.CreateNewSupplierWithLinkToProductById(request.ProductId, request.SupplierName);

            return(response);
        }