1.在操作产品线配置问题中,如果要写死产品线ID
var EntityName =crmForm.ObjectTypeName;
var Guid =crmForm.ObjectId;
Guid =Guid.replace("{","").replace("}","");
var new_products_lineid="采购部ID" ; // new_products_lineid 指的是采购部ID ; 就是说 产品线可以没有这个字段
var CheckPerson = CheckUserName(new_products_lineid,null,EntityName);
2. 在保存按钮当中 从外围得到的值可以根据 crmForm.all.new_procurementsupplier.ForceSumbit=true; 来设置在Save的事件中写
3.现在数据回显 (在表单一填数,在表单二中可以看到)
在SQL中写好数据
private DataSet GetContact(CrmControl _crmcontrol)
{
string sql = @"UPDATE New_procurementsupplier SET New_procurementsupplierstep = (select b.New_procurementsupplierstep from New_supplier_apprise b where b.New_supplier_appriseId='" + this.Base_RequestGuid + "'),New_procurementsupplier=(select b.New_procurementsupplier from New_supplier_apprise b where b.New_supplier_appriseId='" + this.Base_RequestGuid + "'), New_sundicresult=(select b.new_sundicresult from New_supplier_apprise b where b.New_supplier_appriseId ='" + this.Base_RequestGuid + "'),new_bz=(select b.new_bz from New_supplier_apprise b where b.New_supplier_appriseId ='" + this.Base_RequestGuid + "') where New_procurementsupplierId=(select New_gfpjId from New_supplier_apprise where New_supplier_appriseid='" + this.Base_RequestGuid + "')";
return _crmcontrol.ExcuteSqlToDataSet(sql);
}
然后
ArrayList _arrs = new ArrayList();
DataSet ds = GetContact(_crmcontrol); //可以得到SQL语句的结果
foreach (DataRow dr in ds.Tables[0].Rows)
{
try
{
int procurement = Convert.ToInt32(dr["New_procurementsupplierstep"]); //供应商考评等级 (因为等级是picklist类型的)
_arrs.Add(CreatePicklistProperty("New_procurementsupplierstep", procurement));
int supplier = Convert.ToInt32(dr["New_procurementsupplier"]); //合格供应商等级
_arrs.Add(CreatePicklistProperty("New_procurementsupplier", supplier));
_arrs.Add(CreateStringProperty("New_sundicresult", dr["New_sundicresult"].ToString())); //评论
_arrs.Add(CreateStringProperty("New_bz", dr["New_bz"].ToString())); //备注
_arrs.Add(CreateLookupProperty("RequestUserName", this.Base_RequestEntityName, this.Base_RequestGuid)); //确认人
_arrs.Add(CreateLookupProperty("RequestUserName", this.Base_RequestEntityName, this.Base_RequestGuid)); //确认人
}
catch (Exception ex)
{
SenMail("zhang.zheng@founder.com.cn", "更新资料库" + ex.Message, "", false); //报错的时候可以显示出Email
}
}