| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using Core.Mes.Client.Comm;
- using Core.Mes.Client.Comm.Tool;
- using CoreFS.CA06;
- using System.Data;
- namespace Core.StlMes.Client.Qcm
- {
- public class Dal
- {
- private OpeBase _ob = null;
- public Dal(OpeBase ob)
- {
- _ob = ob;
- }
- public CoreProductManageSvr CoreProductManage
- {
- get
- {
- return new CoreProductManageSvr(_ob);
- }
- }
- }
- public class CoreProductManageSvr
- {
- private string _serverName = "com.steering.pss.qcm.CoreProductManage";
- private DalEntity _dal;
- public CoreProductManageSvr(OpeBase ob)
- {
- _dal = new DalEntity("com.steering.pss.qcm.CoreProductManage", ob);
- }
- public DataRow IsExistStdName(params object[] param)
- {
- return _dal.GetRow("IsExistStdName", param);
- }
- public void CopyStd(params object[] param)
- {
- _dal.Set("CopyStd", param);
- }
- }
- public class DalEntity
- {
- private string _serverName = "";
- private OpeBase _ob = null;
- public DalEntity(string serverName, OpeBase ob)
- {
- _serverName = serverName;
- _ob = ob;
- }
- public DataTable GetTable(string methodName, params object[] param)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = _serverName;
- ccp.MethodName = methodName;
- ccp.ServerParams = param;
- ccp = _ob.ExecuteSortResultByQueryToDataTable(ccp, CoreInvokeType.Internal);
- if (ccp == null)
- {
- throw new MESException("服务端处理失败!");
- }
- if (ccp.ReturnCode < 0)
- {
- throw new MESException("服务端处理失败!", ccp.ReturnCode, ccp.ReturnInfo);
- }
- return ccp.SourceDataTable;
- }
- public DataRow GetRow(string methodName, params object[] param)
- {
- DataTable dt = GetTable(methodName, param);
- if (dt.Rows.Count == 0)
- {
- return null;
- }
- else
- {
- return dt.Rows[0];
- }
- }
- public DataSourceList<T> GetData<T>(string methodName, params object[] param)
- {
- return EntityHelper.GetData<T>(_serverName + "." + methodName, param, _ob);
- }
- public object Set(string methodName, params object[] param)
- {
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = _serverName;
- ccp.MethodName = methodName;
- ccp.ServerParams = param;
- ccp = _ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp == null)
- {
- throw new MESException("服务端处理失败!");
- }
- if (ccp.ReturnCode < 0)
- {
- throw new MESException("服务端处理失败!", ccp.ReturnCode, ccp.ReturnInfo);
- }
- return ccp.ReturnObject;
- }
- }
- }
|