U9客开技术点总结文档
UBF
- 继承
- 组合
- 状态机
BE
- 重写单据类型属性
public override DocType DocType
{
get
{
return this.DocumentType;
}
}
- 设置默认值
/// <summary>
/// 设置默认值
/// </summary>
protected override void OnSetDefaultValue()
{
if (this.Org == null)
{
this.Org = UFIDA.U9.Base.Context.LoginOrg;
}
base.OnSetDefaultValue();
}
BP
- 查询代码包括在之内,引用 Runtime\UFSoft.UBF.AopFrame.dll
using (BPForEngine bp = new BPForEngine())
{
//...
}
防止报异常:
- 执行SQL语句的方法 添加引用 UFSoft.UBF.Util.DataAccess.dll、UFSoft.UBF.Sys.Database.dll
DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(),"sql", null);
- 实体查询 XXX.Finder.Find() 带参数
var nextControlPeriod = BudgetControlPeriod.Finder.Find("BudgetYear=@BudgetYear and BudgetControlScheme=@BudgetControlScheme and Num=@Num",
new List<OqlParam>()
{
new OqlParam("BudgetYear", controlPeriod.BudgetYear.ID),
new OqlParam("BudgetControlScheme", controlPeriod.BudgetControlScheme.ID),
new OqlParam("Num", controlPeriod.Num + 1),
}.ToArray());
- 数据会话
using (var session = Session.Open())
{
//...
//提交变更
session.Commit();
}
- 账簿上下文 引用 UFIDA.U9.UI.PDHelper.dll
PDContext.Current.PrimarySOBRef.CodeColumn;
- 组织上下文
PDContext.Current.OrgID;
添加行记录
XXX.Lines.AddNew();
UI
AfterCreateChildControls()
- 注册查找参照
PDFormMessage.ShowConfirmDialog(this.Page, "4540e880-7eb7-4eba-8da7-f1889b092af8", "580", "408", Title, wpFindID.ClientID, this.BtnFind, "");
- 设置默认行号
- 删除提示
AfterUIModelBinding()
- 设置按钮权限
- 设置弹性域
FlexFieldHelper.SetDescFlexField(this.DataGrid8, (this.DataGrid8.Columns.Count - 1));
- 设置行过滤条件
((IUFFldReferenceColumn)this.DataGrid8.Columns["ProductType"]).CustomInParams = BaseAction.Symbol_AddCustomFilter + "= ValueSetDef.Code= 'Z30'";
设置card权限
- 设置异步
- webpart里的AfterOnLoad() || OnLoadDefault()事件获取当然状态值,传给action的方法,aciton里调用BP
this.CurrentState["XXX"]
System.Web.HttpContext.Current.Session["XXX"]
- 页面跳转到指定ID
public void OnLoadDefault()
{
var detailPage = "26210e6c-1396-43b9-a5dd-c6f389950136";
if (System.Web.HttpContext.Current.Session[detailPage] != null)
{
var result = System.Web.HttpContext.Current.Session[detailPage].ToString();
System.Web.HttpContext.Current.Session[detailPage] = null;
long temp;
if (long.TryParse(result, out temp))
{
this.NavigateAction.MovePageAt(null, temp);
}
}
}
- 打开页面默认第一页
private void OnLoadData_Extend(object sender)
{
OnLoadData_DefaultImpl(sender);
var rec = this.Model.BudgetChange.FocusedRecord;
if (rec == null)
{
this.BtnFirstPage_Click(this, new EventArgs());
}
}
URL参数
- 设置
NaviteParamter param = new NaviteParamter();
param.NameValues.Add("PLSID", PLSID);
NavigateManager.ShowModelWebpart(this, "a540abf0-8696-4ea8-be56-2d898ac637ae", this.TaskId.ToString(), 520, 120, param);
- 获取 webpart里
this.NameValues["XXX"]
工作流审批
插件
菜单发布
补丁打包