Ejemplo n.º 1
0
 public virtual K OnExecu <T, K>(T o, BConfig x)
     where T : ExternalReqBase
     where K : ExternalResBase
 {
     try
     {
         using (var dbContext = new DbContextContainer(DbName.HCDb)._DataAccess)
         {
             var dynamicSql = @"SELECT * 
                                  FROM AT_RegDev
                                 WHERE AuthorizeHospitalCode = '" + x.HCode + "' " +
                              "AND RegDevCode = 'Conlin'";
             var dbRegDev = dbContext.Database.Connection.QueryFirstOrDefault <Db_RegDev>(dynamicSql);
             o.ReqHeader = new ReqHeader(dbRegDev, x.BCode, x.TCode, x.OCode);
             var s = String.Empty;
             var v = _ESBClient.ReqBusiness(o.ReqHeader.ReqHospitalCode, o.ReqHeader.ReqCompanyCode, x.TKind, OnEntry(o, x).ToJson(), ref s);
             return(OnExits(s, x).ToEntity <K>());
         }
     }
     catch (Exception ex)
     {
         LogModule.Info("执行ESB请求异常:", ex);
         throw ex;
     }
 }
Ejemplo n.º 2
0
 public virtual T OnEntry <T>(T o, BConfig x) where T : class
 {
     LogModule.Info("执行ESB请求开始:------------------------------------------------------------------------------------------");
     LogModule.Info("执行ESB请求交易:" + x.TKind);
     LogModule.Info("执行ESB请求入参:" + o.ToJson());
     return(o);
 }
Ejemplo n.º 3
0
 public static K InvokeWithESB <T, K>(this T o, BConfig x)
     where T : ExternalReqBase
     where K : ExternalResBase
 {
     try
     {
         x.TKind.IsNullOrEmptyOfVar(x.TKind);
     }
     catch (ArgumentNullException ex)
     {
         throw ex;
     }
     return(new ESBClient(x.HCode).OnExecu <T, K>(o, x));
 }
Ejemplo n.º 4
0
 public virtual T OnExits <T>(T o, BConfig x) where T : class
 {
     LogModule.Info("执行ESB请求出参:" + o);
     return(o);
 }