|
向小铎
发表于 2020-12-11 18:46:48
客户转公海代码
- if(actionName == "TOGH")
- {
- string[] objectids = (string[]) postValue.Data["ObjectIds"];
- if(objectids == null || objectids.Length == 0)
- {
- response.Message = "请先选择数据";
- return;
- }
- foreach(string item in objectids)
- {
- H3.DataModel.BizObject kObj = H3.DataModel.BizObject.Load(this.Request.UserContext.UserId, this.Engine, "D0015992c65d5275f5c497094fc3b6f4d085a77", item, false);
- if(kObj.Status == H3.DataModel.BizObjectStatus.Canceled)
- {
- continue;
- }
- H3.DataModel.BizObject ghBiz = new H3.DataModel.BizObject(this.Engine, this.Engine.BizObjectManager.GetPublishedSchema("D001599Svz5ztxvar7ln6dny8gp5ki3k3"), this.Request.UserContext.UserId);
- ghBiz["company"] = kObj["company"];
- ghBiz["phone"] = kObj["phone"];
- ghBiz["targetObj"] = item;
- ghBiz.Status = H3.DataModel.BizObjectStatus.Effective;
- ghBiz.Create();
- kObj.Status = H3.DataModel.BizObjectStatus.Canceled;
- kObj.OwnerId = H3.Organization.User.SystemUserId;
- kObj.Update();
- }
- }
- <b>公海转客户</b>
- if(actionName == "TOKH")
- {
- string[] objectids = (string[]) postValue.Data["ObjectIds"];
- if(objectids == null || objectids.Length == 0)
- {
- response.Message = "请先选择数据";
- return;
- }
- foreach(string item in objectids)
- {
- H3.DataModel.BizObject ghBiz = H3.DataModel.BizObject.Load(this.Request.UserContext.UserId, this.Engine, "D001599Svz5ztxvar7ln6dny8gp5ki3k3", item, false);
- if(ghBiz["targetObj"] + string.Empty != "")
- {
- H3.DataModel.BizObject kObj = H3.DataModel.BizObject.Load(this.Request.UserContext.UserId, this.Engine, "D0015992c65d5275f5c497094fc3b6f4d085a77", ghBiz["targetObj"] + string.Empty, false);
- kObj.OwnerId = this.Request.UserContext.UserId;
- kObj.Status=H3.DataModel.BizObjectStatus.Effective;
- kObj.Update();
- }
- else
- {
- H3.DataModel.BizObject kObj = new H3.DataModel.BizObject(this.Engine, this.Engine.BizObjectManager.GetPublishedSchema("D0015992c65d5275f5c497094fc3b6f4d085a77"), this.Request.UserContext.UserId);
- kObj["company"] = ghBiz["company"];
- kObj["phone"] = ghBiz["phone"];
- kObj.Status = H3.DataModel.BizObjectStatus.Effective;
- kObj.Create();
- }
- ghBiz.Remove();
- }
- }
复制代码
|
|