开发者学堂课程【低代码氚云应用开发课程:氚云丨开发课— 05 后端代码调试与业务对象操作】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/894/detail/14282
氚云丨开发课— 05 后端代码调试与业务对象操作
后端代码调试与业务对象操作
Load
Remove
Update
Create
1.向某一个目标表中添加一个子表行
2.表单赋值
Schemacode
Bizobjectid
f5 是继续
f10 下一步
f11 走到方法里面去
f9 打断点!
//response.ReturnData["F8060003"].Visible=false;
//1获取当前的人H3.Organization.OrgRole[] roles = this.Request.Engine.Organization.GetUserRoles(this.Request.UserContext.UserId, true);
bool flag=false;
foreach(H3.Organization.OrgRole item in roles)
if(i
tem.Name =="金额查看")
flag = true;
//response.ReturnData["money"].Visible = flag;
response.Message=flag+string.Empty;
protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response
this.Request.Bizobject["Foee0681"]=postValue.Data["F6600001"]+string.Empty;
T base.OnSubmit(actionName, postValue, response);
using System;
using System.Collections.Generic;
using System.Text;
using H3;
public class De@1599291e3e4225694aba9bae578d4e77ac93 :
H3.SmartForm.SmartFormController
public D801599291e3e4225694aba9bae578d4e77ac93(H3.SmartForm.SmartFormRequest request): base(request)
protected override void OnLoad(H3.SmartForm.LoadSmartFormResponse response)
base.OnLoad(response);
protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
H3.DataModel.BizObject biz=H3.DataModel.BizObject.Load(H3.Organization.User.SystemUserId,this.Engine,"D86159996612abb965e47f7b4b799f2f37fa792",this
biz["Gender"]=this.Request.BizObject["Gender"]+string.Empty;
biz.Update();
base.Onsubmit(actionName, postValue, response);
Load
Update
Remove
create
1.向某一个目标表中添加一个子表行
2.表单赋值
SchemaCode
Bizobjectid
Bizobject 的操作
公司名称
地址
联系人。
联系人电话
using H3;
public class D881599d6bdf799a4954d8992418ce2dbec4832:H3.SmartForm.SmartFormControllen
public D861599d6bdf799a4954de992418ce2dbec4832(H3.SmartForm.SmartFormRequest request): base(request)
protected override void OnLoad(H3.SmartForm.LoadSmartFormResponse response)
base.OnLoad(response);
protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
if(actionName == "Submit")
H3.DataModel.BizObjectSchema schema=this.Engine.BizObjectManager.GetPublishedSchema("D6615993c7eb91debd64e8ba25dd325e0d2131b");
H3.DataModel.BizObject targetBiz=new H3.DataModel.BizObject(this.Engine,schema,this.Request.UserContext.UserIdbase.OnSubmit(actionName, postvalue, response);
protected override void OnLoad(H3.SmartForm.LoadSmartFormResponse response)
base.OnLoad(response);
protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response)
if(actionName =="Submit")
H3.DataModel.BizObjectSchema schema=this.Engine.BizobjectManager.GetPublishedSchema("D9015993c7eb91debd64e8ba25dd325e8d2131b");
HB.DataModel.BizObject targetBiz=new H3.DataModel.BizObject(this.Engine,schema,this.Request.UserContext.UserId);
targetBiz["userName"]=this.Request.BizObject["userName"]+string.Empty;
targetBiz["userPhone"]=this.Request.BizObject["userphone"]+string.Empty;
targetBiz["kehu"]=this.Request.BizobjectId;
targetBiz.Status=H3.Dataode1.BizObjectstatus.Effective;
targetBiz.Create();
base.OnSubmit(actionName, postValue, response);
Load
Update
Remove
create
1.向某一个目标表中添加一个子表行
2.表单赋值
SchemaCode
Bizobjectid
Bizobject 的操作
公司名称
地址
联系人。、
联系人电话
联系人
联系人电话
1获取客户的对象
2把子表对象获取到
3往子表对象里面添加一行子表
4赋值给客户(主表)对象
5调用 Update
if(actionName =="Submit")
H3.DataModel.BizObject biz = H3.DataMode1.BizObject.Load(this.Request.UserContext.UserId, this.Engine,"D801599d6bdf799a4954d8992418ce2dbec4832
H3.DataModel.BizObject[] bizChild =
(H3.DataModel.BizObject[]) biz["De61599Fe3cb967167924d27a6647c7c757698ba"];
List <H3.DataModel.BizObject 〉 childList=new List<H3.DataModel.BizObject>();
if(bizchild != null)
chifpList,AddRange(bizChild);
//先把原来的子表存起来
//创建子表对象H3.DataModel.BizObjectSchema schema=this.Engine.BizObjectManager.GetPublishedSchema("D661599F63cb967167924d27a6647c7c757698ba");
H3.DataModel.BizObject childBiz=new H3.DataModel.BizObject(this.Engine,schema,this.Request.UserContext.UserId);
childBiz["staff"]=this.Request.BizObject["staff"]+string.Empty;
childBiz["date"]=this.Request.Bizobject["data"]+string.Empty;
childlist.Add(childBiz);
biz["D801599Fe3cb967167924d27a6647c7c757698ba"]=childList.ToArray();
biz.Update();
base.OnSubmit(actionName, postValue, response);