public void Add(CRM_Product product) { if (product != null) { _dbContext.CRM_Product.Add(product); } }
/// <summary> /// 点击修改加载修改信息 /// </summary> public void LoadUpdateProduct() { frmProduct fp; fp = (frmProduct)this.Owner; proId = fp.GetUpdateCRM_ProductId(); cp = cpl.GetCRM_ProductModel(proId); tbProductName.Text = cp.Name; tbCateGory.Text = cp.Category; tbUnit.Text = cp.Unit; tbQuantity.Text = cp.Quantity.ToString(); tbIntroduction.Text = cp.Introduction; }
public int Update(CRM_Product product) { cpl.Update(product); int result = cpl.SaveChanges(); if (result > 0) { return(1); } else { return(0); } }
public void Update(CRM_Product product) { var updateproduct = _dbContext.CRM_Product.Find(product.Id); if (updateproduct != null) { updateproduct.MId = product.MId; updateproduct.MDate = product.MDate; updateproduct.Name = product.Name; updateproduct.Category = product.Category; updateproduct.Unit = product.Unit; updateproduct.Quantity = product.Quantity; updateproduct.Introduction = product.Introduction; } }