U871开发指导

2026/1/27 19:18:42

UAP开发指导文档

#region 锁定按钮----新增功能开发 using System; using System.Collections.Generic; using System.Text; using UFIDA.U8.UAP.UI.Runtime.Model; using System.Windows.Forms; using System.Data.SqlClient; namespace ufida.u8.uap.plugin.SalesVoucher { public class LockVoucherButton : IButtonEventHandler { public LockVoucherButton() { } #region IButtonEventHandler 成员 public string Excute(VoucherProxy ReceiptObject, string PreExcuteResult) { bool result = false; SqlConnection conn=new SqlConnection(ReceiptObject.LoginInfo.UFDataSqlConSt SqlTransaction tran = null; SqlDataReader rd = null; try { conn.Open(); tran=conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted); SqlCommand cmd = conn.CreateCommand(); Business b = ReceiptObject.Businesses[\] as Business; BusinessCell cell = b.Cells[\] as BusinessCell; string pkValue = cell.Value; cmd.CommandText = \cVerifier, cCloser,cLocker from so_somain where cSOCode = '\ + pkValue + \; cmd.Transaction = tran; rd = cmd.ExecuteReader(); if (rd.Read()) { string auditMan = \; string closeMan = \; string lockMan = \; if (!rd.IsDBNull(0)) { auditMan = rd.GetString(0); } if (!rd.IsDBNull(1)) { closeMan = rd.GetString(1); } if (!rd.IsDBNull(2)) { lockMan = rd.GetString(2);

21 of 90

UAP开发指导文档

注意项

2) UAP已有功能的修改开发 说明

UAP已经实现了新增表单的保存方法,但是我们可能在使用UAP保存逻辑的基础之上,在保存之前或保存之后对表单的某些数据做一定的修改。具体就是对表单模型中的某些实体属性的值根据业务逻辑的需要做必要的修改再执行已有的表单保存。

22 of 90

UAP开发指导文档

示例

using System; using System.Collections.Generic; using System.Text; using UFIDA.U8.UAP.UI.Runtime.Model; using UFIDA.U8.UAP.UI.Runtime.Common; using System.Xml; namespace ufida.u8.uap.plugin.SalesVoucher { ///

/// 接受订单按钮处理 /// public class AcceptOrderButton : IButtonEventHandler { #region IButtonEventHandler 成员 public string Excute(VoucherProxy ReceiptObject, string PreExcuteResult) { return null; } public string Excuted(VoucherProxy ReceiptObject, string PreExcuteResult) { if (!ReadExcuteState(PreExcuteResult)) { if (ReceiptObject.VoucherState == VoucherStateEnum.New) { if (ReceiptObject.Businesses.ContainsKey(\)) { Business b = ReceiptObject.Businesses[\] as Business; if (b.Rows.Count > 0) { if (b.Columns.ContainsKey(\)) { BusinessCell cell = b.Cells[\] as BusinessCell; cell.Value = \; } } } } return null; } return MakeExcuteState(true, \保存成功\); } public string Excuting(VoucherProxy ReceiptObject) { if (ReceiptObject.VoucherState == VoucherStateEnum.New) { if (ReceiptObject.Businesses.ContainsKey(\)) { Business b = ReceiptObject.Businesses[\] as Business; if (b.Rows.Count > 0) 双击查看代码

23 of 90

UAP开发指导文档

注意项

3) UAP已有功能的替代开发 说明

UAP系统中已经实现了一些公共功能,但这些功能并不一定适用于每种不同表单的具体情况,所以有些时候我们可能需要对UAP的已经实现的功能进行替代开发。替代开发分为两种:在实现业务基础上直接操作数据库、调用U8已经实现的该表单审核功能的API方法。

直接操作数据库:直接操作数据库的开发方法与下面的“新增功能开发”的开发方法大体一致,此处不再细述。

调用业务API:调用业务API方法避免了开发人员必须去了解当前功能的具体业务,降低了开发的复杂程度,有利于快速而准确的开发。但是在使用业务API之前,必须首先掌握在.Net中调用U8中API的方法,其次需要知道有那些API可以使用,各个API方法的参数和返回值代表的意义,以及根据API的参数和返回值确定你的表单开发过程的业务流程等。

Net中如何调用U8中的API

///

/// 执行U8业务API ///

///

///

\\UAP\\BusinessInterface\\Framework\\UFSoft.U8.Business.Interface.config文件中的APIRepository节点的子节点Product 节点的name属性值

///

///

///

\\UAP\\BusinessInterface\\Framework\\UFSoft.U8.Business.Interface.config文件中的APIRepository节点的子节点Product 节点的version属性值 /// /// 业务API方法的返回值

static object ExcutingAPI(LoginInfo login,string regUnitName,string adapterName,string apiName,string version,Hashtable parameters) { }

参数login:表示U8登录对象; 参

regUnitName

U8

24 of 90


U871开发指导.doc 将本文的Word文档下载到电脑
搜索更多关于: U871开发指导 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219