public override void DataChanged(DataChangedEventArgs e)
{
switch (e.Key.ToUpperInvariant())
{
case "FBILLTYPEID":
DynamicObject obj = this.View.Model.DataObject["BillTypeID"] as DynamicObject;
string newbillTypeId = string.Empty;
if (obj != null && obj["id"].ToString() != "0")
{
newbillTypeId = obj["id"].ToString();
}
string businessType = "";
DynamicObject billTypePara = BusinessDataServiceHelper.LoadBillTypePara(this.Context, "SAL_OSBillTypeParaSetting", newbillTypeId);
if (billTypePara != null)
{
businessType = Convert.ToString(billTypePara["BussinessType"]);
}
if (businessType.EqualsIgnoreCase("CONSIGNMENT") &&
(this.View.OpenParameter.CreateFrom == CreateFrom.Default ||
this.View.OpenParameter.CreateFrom == CreateFrom.Copy))
{
//billTypePara["BussinessType"] = "";
this.Model.SetValue("FBillTypeID", "ad0779a4685a43a08f08d2e42d7bf3e9");
this.View.ShowMessage("不允许选择寄售单据类型");
}
break;
}
}
例如:销售出库单,单据类型修改,当是“寄售出库单”时将单据类型修改为“标准销售出库单”
这段代码,怎么赋值不成功呢?
推荐阅读