コード例 #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;

            });
        }
コード例 #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;

            });
        }
コード例 #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;

            });
        }
コード例 #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;

            });
        }
コード例 #5
0
 partial void DeleteProduct(Product instance);
コード例 #6
0
 partial void UpdateProduct(Product instance);
コード例 #7
0
 partial void InsertProduct(Product instance);
コード例 #8
0
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductModel = null;
		}
コード例 #9
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductModel = this;
		}
コード例 #10
0
		private void detach_Products1(Product entity)
		{
			this.SendPropertyChanging();
			entity.UnitMeasure1 = null;
		}
コード例 #11
0
		private void attach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.UnitMeasure = this;
		}
コード例 #12
0
		private void detach_Products(Product entity)
		{
			this.SendPropertyChanging();
			entity.ProductSubcategory = null;
		}
コード例 #13
0
 public void ProductDelete(Product product)
 {
     adventureWorks_BC.ProductDelete(product);
 }
コード例 #14
0
 public void ProductAdd(Product product)
 {
     adventureWorks_BC.ProductAdd(product);
 }
コード例 #15
0
 public void ProductUpdate(Product product)
 {
     adventureWorks_BC.ProductUpdate(product);
 }