1.引用
1 IResult result = ExecuteDmsParam<DMSParam, ORD_PurchaseParam>(dmsParam, purchaseParam, "HQBuy.MVC.BLL.Member.ORD.ORD_PurchaseBLL", "GetPurchaseByPNO");
2.方法
public IResult ExecuteDmsParam<T1, T2>(T1 t1, T2 t2, string ClassName, string MethodName) { Type type = t1.GetType(); if (type.GetProperties() != null && type.GetProperties().Length > 0) { foreach (var propertie in type.GetProperties()) { if (!string.IsNullOrEmpty(propertie.Name)) { switch (propertie.Name) { case "AssemblyName": t1.GetType().GetProperty(propertie.Name).SetValue(t1, "HQBuy.MVC.BLL.Member.dll"); break; case "ClassName": t1.GetType().GetProperty(propertie.Name).SetValue(t1, ClassName); break; case "MethodName": t1.GetType().GetProperty(propertie.Name).SetValue(t1, MethodName); break; case "Param": t1.GetType().GetProperty(propertie.Name).SetValue(t1, t2); break; } } } } IResult result = ExecuteBLL.Execute((IParam)t1); if(result.Complete == DMSComplete.Succeed) { ConditionResult<ORD_Purchase> purchaseCondition = new ConditionResult<ORD_Purchase>(); if (result.Result != null) { purchaseCondition = (ConditionResult<ORD_Purchase>)result.Result; List<ORD_Purchase> purchaseList = (purchaseCondition).ResultList; } } return result; }
时间: 2024-10-11 10:34:23