示例#1
0
        public bool Save(Product product)
        {
            Product pd = new Product();

            pd.Id            = Guid.NewGuid();
            pd.Name          = product.Name;
            pd.Description   = product.Description;
            pd.Price         = product.Price;
            pd.DeliveryPrice = product.DeliveryPrice;
            _dalObj          = new ProductsDAL();
            if (!_dalObj.Save(pd))
            {
                return(false);
            }
            return(true);
        }
示例#2
0
        public bool Save(Guid productId, ProductOption option)
        {
            ProductOption prodOpt = new ProductOption
            {
                Id          = Guid.NewGuid(),
                ProductId   = productId,
                Name        = option.Name,
                Description = option.Description
            };

            _dalObj = new ProductsDAL();
            if (!_dalObj.Save(productId, prodOpt))
            {
                return(false);
            }
            return(true);
        }