CRM细节(6)代码问题

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
                        }

                    }

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值