示例#1
0
        public void Update(ProductModel product)
        {
            var updatedProduct = GetByProductCode(product.ProductCode);

            updatedProduct.Price = product.Price;
            //updatedProduct.ProductCode = product.ProductCode;
            updatedProduct.Stock = product.Stock;
            _db.Update(updatedProduct);
            _db.SaveChanges();
        }
示例#2
0
        public void Update(CampaignModel campaign)
        {
            var updatedCampaign = GetByCampaignName(campaign.CampaignName);

            updatedCampaign.Duration               = campaign.Duration;
            updatedCampaign.CampaignName           = campaign.CampaignName;
            updatedCampaign.PriceManipulationLimit = campaign.PriceManipulationLimit;
            updatedCampaign.ProductCode            = campaign.ProductCode;
            updatedCampaign.TargetSalesCount       = campaign.TargetSalesCount;
            updatedCampaign.Status = campaign.Status;

            _db.Update(updatedCampaign);
            _db.SaveChanges();
        }