public frmEditorPICK08(TEntityPICK08 entity) : this() { SetEntity(entity); if (entity != null && entity.ExChange.Count > 0) { TEntityXMLPICK08 exchange = entity.ExChange[0] as TEntityXMLPICK08; edtUserID.Text = exchange.UserID; edtPassword.Text = exchange.PassWord; edtOrderNumber.Text = exchange.OrderNumber; edtLineNumber.Text = exchange.LineNumber; edtItemNumber.Text = exchange.ItemNumber; edtLotNumber.Text = exchange.LotNumber; edtStockroom.Text = exchange.Stockroom; edtBin.Text = exchange.Bin; edtIssuedQuantity.Text = exchange.IssuedQuantity; itemNumber = exchange.ItemNumber; lotNumber = exchange.LotNumber; skuID = entity.SKUID; edtErrText.Text = entity.ErrText; ShowPWOMaterialTrackInfo( entity.SKUID, exchange.OrderNumber, Tools.ConvertToInt32(exchange.LineNumber)); } }
protected override bool SetValue() { if (entity != null && entity.ExChange.Count > 0) { TEntityXMLPICK08 exchange = entity.ExChange[0] as TEntityXMLPICK08; try { Quantity issuedQty = new Quantity() { Scale = materialTrack.Scale, DoubleValue = Convert.ToDouble(edtIssuedQuantity.Text), }; if (issuedQty.IntValue != materialTrack.QtyLoaded) { ((TEntityPICK08)entity).QtyLoaded = issuedQty; } } catch (Exception error) { error.Data["ErrCode"] = 999999; error.Data["ErrText"] = string.Format( "无法将 [{0}] 转换成数值!", edtIssuedQuantity.Text); MSGHelp.Instance.ShowErrorMessage(error); edtIssuedQuantity.Text = exchange.IssuedQuantity; edtIssuedQuantity.Focus(); return(false); } exchange.UserID = edtUserID.Text; exchange.PassWord = edtPassword.Text; exchange.OrderNumber = edtOrderNumber.Text; exchange.LineNumber = edtLineNumber.Text; exchange.ItemNumber = edtItemNumber.Text; exchange.LotNumber = edtLotNumber.Text; exchange.Stockroom = edtStockroom.Text; exchange.Bin = edtBin.Text; exchange.IssuedQuantity = edtIssuedQuantity.Text; return(true); } else { return(false); } }