Exemplo n.º 1
0
 public CPProductDetailModel getListCpProdForContract(long counterPartyId, string cifCounterParty, string counterPartyGroup, DateTime?dataDate, string userId)
 {
     try
     {
         CPProductDetailModel resultObject = new CPProductDetailModel();
         SqlParameter[]       prms         = new SqlParameter[]
         {
             new SqlParameter {
                 ParameterName = "counterPartyId", DbType = DbType.Int64, Value = counterPartyId, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "cifCounterParty", DbType = DbType.String, Value = string.IsNullOrEmpty(cifCounterParty) ? (object)DBNull.Value : cifCounterParty, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "counterPartyGroup", DbType = DbType.String, Value = string.IsNullOrEmpty(counterPartyGroup) ? (object)DBNull.Value : counterPartyGroup, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "dataDate", DbType = DbType.Date, Value = dataDate != null ? (object)DBNull.Value : dataDate, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "userId", DbType = DbType.String, Value = userId == null ? (object)DBNull.Value : userId, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue
             }
         };
         var result = _Repository.ExecWithStoreProcedureCommand(Store_getListCpProdForContract, prms);
         if (result.errorCode == 0)
         {
             resultObject = JsonConvert.DeserializeObject <CPProductDetailModel>(result.errorMessage);
         }
         else
         {
             HDBH.Log.WriteLog.Error("CPProductService => Store_getListCpProdForContract => Detail" + result.errorMessage);
         }
         return(resultObject);
     }
     catch (Exception ex)
     {
         HDBH.Log.WriteLog.Error("CPProductService => Store_getListCpProdForContract", ex);
         return(null);
     }
 }
Exemplo n.º 2
0
 public CPProductDetailModel getDetailCpProdCommis(CPProductGetDetailViewModel input)
 {
     try
     {
         CPProductDetailModel resultObject = new CPProductDetailModel();
         SqlParameter[]       prms         = new SqlParameter[]
         {
             new SqlParameter {
                 ParameterName = "counterPartyId", DbType = DbType.Int64, Value = input.counterPartyId, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "cifCounterParty", DbType = DbType.String, Value = string.IsNullOrEmpty(input.cifCounterParty) ? (object)DBNull.Value : input.cifCounterParty, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "counterPartyGroup", DbType = DbType.String, Value = string.IsNullOrEmpty(input.counterPartyGroup) ? (object)DBNull.Value : input.counterPartyGroup, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "isInau", DbType = DbType.Int32, Value = input.isInau, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "userId", DbType = DbType.String, Value = input.userId == null ? (object)DBNull.Value : input.userId, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "resultMessage", DbType = DbType.String, Direction = ParameterDirection.Output, Size = Int32.MaxValue
             },
             new SqlParameter {
                 ParameterName = "resultCode", DbType = DbType.Int32, Direction = ParameterDirection.Output, Size = Int32.MaxValue
             }
         };
         var result = _Repository.ExecWithStoreProcedureCommand(Store_getDetailCpProdCommis, prms);
         if (result.errorCode == 0)
         {
             resultObject = JsonConvert.DeserializeObject <CPProductDetailModel>(result.errorMessage);
         }
         else
         {
             HDBH.Log.WriteLog.Error("CPProductService => getDetailCpProdCommis => Detail" + result.errorMessage);
         }
         return(resultObject);
     }
     catch (Exception ex)
     {
         HDBH.Log.WriteLog.Error("CPProductService => getDetailCpProdCommis", ex);
         return(null);
     }
 }