public override int Modify() { if (_fish == null) { MessageBox.Show("请查询需要修改的进仓单。"); return(0); } decimal temp = 0; _fish.Code = txtcode.Text.ToString(); _fish.Requester = txtRequester.Text.Trim(); _fish.Shipname = txtShipname.Text.Trim(); decimal.TryParse(txttonnage.Text, out temp); _fish.Tonnage = temp; _fish.TName = cmbtName.SelectedValue == null ? string.Empty : cmbtName.SelectedValue.ToString().Trim(); _fish.Billnumber = txtBillnumber.Text; decimal.TryParse(txtNumberOfPieces.Text, out temp); _fish.NumberOfPieces = temp; _fish.Unpackingdate = dtpUnpackingdate.Value; decimal.TryParse(txtactualnumber.Text, out temp); _fish.Actualnumber = temp; _fish.StorageLocation = txtStorageLocation.Text.Trim(); _fish.Position = txtposition.Text.Trim(); _fish.Remarks = txtRemarks.Text.Trim(); _fish.Modifytime = DateTime.Now; _fish.Modifyman = FishEntity.Variable.User.username; _fish.TO = txtTO.Text.Trim(); _fish.Zhuangjiao = txtZhuangjiao.Text; _fish.ContractNo = txtContractNo.Text; _fish.TEL = txtTEL.Text.Trim(); _fish.ANTI = txtANTI.Text.Trim(); _fish.FAX = txtFAX.Text.Trim(); FishBll.Bll.EnterWarehouseReceiptsBll bll = new FishBll.Bll.EnterWarehouseReceiptsBll(); bool isOk = bll.Update(_fish); if (isOk) { MessageBox.Show("修改成功。"); } else { //txtcode.Text = string.Empty; MessageBox.Show("修改失败。"); } return(1); }
public override int Modify() { if (_entity == null) { MessageBox.Show("请查询需要修改的进仓单。"); return(0); } int temp = 0; _entity.anti = txtanti.Text; _entity.code = txtCode.Text; _entity.codeNum = txtcodeNum.Text; _entity.codeNumContract = txtcodeNumContract.Text; _entity.deliverybills = txtdeliverybills.Text; _entity.enUntil = txtenUntil.Text; _entity.fat = txtfat.Text; _entity.fax = txtfax.Text; _entity.fishId = txtfishId.Text; _entity.hf = txthf.Text; _entity.location = txtlocation.Text; _entity.locationDis = txtlocationDis.Text; int.TryParse(txtnumber.Text, out temp); _entity.number = temp; temp = 0; int.TryParse(txtnumOfPack.Text, out temp); _entity.numOfPack = temp; _entity.protein = txtprotein.Text; _entity.remark = txtremark.Text; _entity.sand = txtsand.Text; _entity.shipno = txtshipno.Text; _entity.shy = txtshy.Text; _entity.TEL = txtTEL.Text; _entity.TO = txtTO.Text; _entity.TVN = txtTVN.Text; _entity.water = txtwater.Text; _entity.za = txtza.Text; _entity.brand = cmbbrand.Text; _entity.country = cmbcountry.Text; _entity.proName = cmbproName.Text; _entity.qualitySpe = cmbqualitySpe.Text; _entity.downDate = dtdownDate.Value; decimal te = 0; decimal.TryParse(txtHeight.Text, out te); _entity.height = te; FishBll.Bll.EnterWarehouseReceiptsBll bll = new FishBll.Bll.EnterWarehouseReceiptsBll(); bool isOk = bll.Update(_entity); if (isOk) { MessageBox.Show("修改成功。"); } else { //txtcode.Text = string.Empty; MessageBox.Show("修改失败。"); } return(1); }