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 { ///
23 of 90
UAP开发指导文档
注意项
3) UAP已有功能的替代开发 说明
UAP系统中已经实现了一些公共功能,但这些功能并不一定适用于每种不同表单的具体情况,所以有些时候我们可能需要对UAP的已经实现的功能进行替代开发。替代开发分为两种:在实现业务基础上直接操作数据库、调用U8已经实现的该表单审核功能的API方法。
直接操作数据库:直接操作数据库的开发方法与下面的“新增功能开发”的开发方法大体一致,此处不再细述。
调用业务API:调用业务API方法避免了开发人员必须去了解当前功能的具体业务,降低了开发的复杂程度,有利于快速而准确的开发。但是在使用业务API之前,必须首先掌握在.Net中调用U8中API的方法,其次需要知道有那些API可以使用,各个API方法的参数和返回值代表的意义,以及根据API的参数和返回值确定你的表单开发过程的业务流程等。
Net中如何调用U8中的API
///
///
///
\\UAP\\BusinessInterface\\Framework\\UFSoft.U8.Business.Interface.config文件中的APIRepository节点的子节点Product 节点的name属性值
///
///
///
\\UAP\\BusinessInterface\\Framework\\UFSoft.U8.Business.Interface.config文件中的APIRepository节点的子节点Product 节点的version属性值 /// ///
static object ExcutingAPI(LoginInfo login,string regUnitName,string adapterName,string apiName,string version,Hashtable parameters) { }
参数login:表示U8登录对象; 参
数
regUnitName
:
注
册
单
元
名
称
。
U8
安
装
目
录
24 of 90

