//获取客户ID
var FCUSTobject = this.View.Model.GetValue("FCustId").ToString();
var sql = string.Format(@"/*dialect*/SELECT TOP 1 FMATERIALID,F_WKYC_TEXT1, F_WKYC_Text2, F_WKYC_Text3,
F_WKYC_Text4, F_WKYC_Combo1, F_WKYC_Combo, F_WKYC_Combo3, F_WKYC_Combo2, F_WKYC_Text5
FROM T_SAL_ORDERENTRY WHERE F_WKYC_TEXT1 = " + KHLH +"ORDER BY FENTRYID DESC");
//根据条件获取到需要的销售订单明细数据信息
var SALORDERObjects = DBUtils.ExecuteDynamicObject(this.Context, sql);
var SALORDERObject = SALORDERObjects.FirstOrDefault();
if (SALORDERObject != null)
{
//客户料号
var FMaterialId_1 = SALORDERObject.GetDynamicObjectItemValue<string>("FMaterialId");
//客户牌号
var F_WKYC_Text2 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Text2");
//实际牌号
var F_WKYC_Text3 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Text3");
//公差
var F_WKYC_Text4 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Text4");
//是否充磁
var F_WKYC_Combo1 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Combo1");
//充磁方法
var F_WKYC_Combo = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Combo");
//镀层
var F_WKYC_Combo3 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Combo3");
//级别
var F_WKYC_Combo2 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Combo2");
//客户生产编号
var F_WKYC_Text5 = SALORDERObject.GetDynamicObjectItemValue<string>("F_WKYC_Text5");
// 将查询的值赋给物料ID字段
this.View.Model.SetValue("FMaterialId", FMaterialId_1, index);
// 将查询的值赋给客户牌号字段
this.View.Model.SetValue("F_WKYC_Text2", F_WKYC_Text2, index);
// 将查询的值赋给实际牌号字段
this.View.Model.SetValue("F_WKYC_Text3", F_WKYC_Text3, index);
// 将查询的值赋给公差字段
this.View.Model.SetValue("F_WKYC_Text4", F_WKYC_Text4, index);
// 将查询的值赋给是否充磁字段
this.View.Model.SetValue("F_WKYC_Combo1", F_WKYC_Combo1, index);
// 将查询的值赋给充磁方法字段
this.View.Model.SetValue("F_WKYC_Combo", F_WKYC_Combo, index);
// 将查询的值赋给镀层字段
this.View.Model.SetValue("F_WKYC_Combo3", F_WKYC_Combo3, index);
// 将查询的值赋给级别字段
this.View.Model.SetValue("F_WKYC_Combo2", F_WKYC_Combo2, index);
// 将查询的值赋给客户生产编号字段
this.View.Model.SetValue("F_WKYC_Text5", F_WKYC_Text5, index);
}
this.View.UpdateView("FSaleOrderEntry");