public override int Delete() { if (_entity == null) { return(0); } string msg = string.Format("你确定要删除提货单号为【{0}】的记录吗?", _entity.code); if (MessageBox.Show(msg, "询问", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return(0); } _bll.Delete(_entity.id); FishBll.Bll.LoadingDetailBll detailbll = new FishBll.Bll.LoadingDetailBll(); List <FishEntity.LoadingDetailEntity> details = detailbll.GetDetailOfBill(_entity.id); if (details != null) { FishBll.Bll.ProductBll productBll = new FishBll.Bll.ProductBll(); foreach (FishEntity.LoadingDetailEntity item in details) { //FishEntity.ProductEntity product = productBll.GetModel(item.productid); //if (product == null) continue; //if (product.state == FishEntity.Constant.STATE_SELFMAKE.ToString ()) //{ // productBll.UpdateHomemadeWeightQuantity(item.productid , item.tons, item.packages ); //} //else //{ // productBll.UpdateRemainWeightQuantity(item.productid , item.tons, item.packages); //} FishBll.Bll.ProductExBll productexbll = new FishBll.Bll.ProductExBll(); productexbll.UpdateSaleInfo(item.productid, -item.tons, -item.packages); FishBll.Bll.ContractDetailBll contractdetailbll = new FishBll.Bll.ContractDetailBll(); contractdetailbll.UpdateContractWeight(item.contractid, item.contractdetailid, -item.tons, -item.packages); } } detailbll.DeleteByMid(_entity.id); ClearText(); Query(); return(1); }
protected void UpdateProductCount(int productId, decimal weight, int quanity) { //FishBll.Bll.ProductBll productBll = new FishBll.Bll.ProductBll(); //FishEntity.ProductEntity product = productBll.GetModel(productId); //if (product.state == FishEntity.Constant.STATE_SELFMAKE.ToString()) //{ // productBll.UpdateHomemadeWeightQuantity(productId, weight, quanity); //} //else //{ // productBll.UpdateRemainWeightQuantity(productId, weight, quanity); //} FishBll.Bll.ProductExBll productexbll = new FishBll.Bll.ProductExBll(); productexbll.UpdateSaleInfo(productId, weight, quanity); }
protected void UpdateProductCount(int productId, decimal weight, int quanity) { FishBll.Bll.ProductExBll productexbll = new FishBll.Bll.ProductExBll(); productexbll.UpdateSaleInfo(productId, weight, quanity); }