Exemplo n.º 1
0
        public bool ProductDelete(Product product)
        {
            return Execute<bool>(dal =>
            {
                Product productDelete = dal.Product.Where(x => x.ProductID == product.ProductID).FirstOrDefault();
                if (productDelete != null)
                {
                    dal.Product.DeleteOnSubmit(productDelete);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
Exemplo n.º 2
0
        public bool ProductAdd(Product product)
        {
            return Execute<bool>(dal =>
            {
                Product productAdd = dal.Product.Where(x => x.ProductID == product.ProductID).FirstOrDefault();
                if (productAdd != null)
                {
                    dal.Product.InsertOnSubmit(productAdd);
                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
Exemplo n.º 3
0
        public bool ProductsUpdate(Product product)
        {
            return Execute<bool>(dal =>
            {
                Product productUpdate = dal.Product.Where(x => x.ProductID == product.ProductID).FirstOrDefault();
                if (productUpdate != null)
                {
                    productUpdate.BillOfMaterials = product.BillOfMaterials;
                    productUpdate.BillOfMaterials1 = product.BillOfMaterials1;
                    productUpdate.Class = product.Class;
                    productUpdate.Color = product.Color;
                    productUpdate.DaysToManufacture = product.DaysToManufacture;
                    productUpdate.DiscontinuedDate = product.DiscontinuedDate;
                    productUpdate.FinishedGoodsFlag = product.FinishedGoodsFlag;
                    dal.SubmitChanges();
                    return  true;
                }
                return false;

            });
        }
Exemplo n.º 4
0
        public bool ProductUpdate(Product product)
        {
            return Execute<bool>(dal =>
            {
                Product productUpdate = dal.Product.Where(x => x.ProductID == product.ProductID).FirstOrDefault();
                if (productUpdate != null)
                {
                    productUpdate.ProductID = product.ProductID;
                    productUpdate.Name = product.Name;
                    productUpdate.ProductNumber = product.ProductNumber;
                    productUpdate.MakeFlag = product.MakeFlag;
                    productUpdate.FinishedGoodsFlag = product.FinishedGoodsFlag;
                    productUpdate.Color = product.Color;
                    productUpdate.SafetyStockLevel = product.SafetyStockLevel;
                    productUpdate.ReorderPoint = product.ReorderPoint;
                    productUpdate.StandardCost = product.StandardCost;
                    productUpdate.ListPrice = product.ListPrice;
                    productUpdate.Size = product.Size;
                    productUpdate.SizeUnitMeasureCode = product.SizeUnitMeasureCode;
                    productUpdate.WeightUnitMeasureCode = product.WeightUnitMeasureCode;
                    productUpdate.Weight = product.Weight;
                    productUpdate.DaysToManufacture = product.DaysToManufacture;
                    productUpdate.ProductLine = product.ProductLine;
                    productUpdate.Class = product.Class;
                    productUpdate.Style = product.Style;
                    productUpdate.ProductSubcategoryID = product.ProductSubcategoryID;
                    productUpdate.ProductModelID = product.ProductModelID;
                    productUpdate.SellStartDate = product.SellStartDate;
                    productUpdate.SellEndDate = product.SellEndDate;
                    productUpdate.DiscontinuedDate = product.DiscontinuedDate;
                    productUpdate.rowguid = product.rowguid;
                    productUpdate.ModifiedDate = product.ModifiedDate;

                    dal.SubmitChanges();
                    return true;
                }
                return false;

            });
        }
 partial void DeleteProduct(Product instance);
 partial void UpdateProduct(Product instance);
 partial void InsertProduct(Product instance);
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductModel = null;
		}
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductModel = this;
		}
		private void detach_Products1(Product entity)
		{
			this.SendPropertyChanging();
			entity.UnitMeasure1 = null;
		}
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.UnitMeasure = this;
		}
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductSubcategory = null;
		}
Exemplo n.º 13
0
 public void ProductDelete(Product product)
 {
     adventureWorks_BC.ProductDelete(product);
 }
Exemplo n.º 14
0
 public void ProductAdd(Product product)
 {
     adventureWorks_BC.ProductAdd(product);
 }
Exemplo n.º 15
0
 public void ProductUpdate(Product product)
 {
     adventureWorks_BC.ProductUpdate(product);
 }