本文整理汇总了C#中APB.Mercury.DataObjects.DefNpj.OperationResult.Trace方法的典型用法代码示例。如果您正苦于以下问题:C# OperationResult.Trace方法的具体用法?C# OperationResult.Trace怎么用?C# OperationResult.Trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APB.Mercury.DataObjects.DefNpj.OperationResult
的用法示例。
在下文中一共展示了OperationResult.Trace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Insert
public static OperationResult Insert(DataFieldCollection pValues, ConnectionInfo pInfo)
{
Transaction lTransaction;
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (lTransaction != null);
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(NPJ_ALUNOXATENDIMENTOQD.TableName, NPJ_ALUNOXATENDIMENTOQD.TableName);
if (!lReturn.HasError){
try{
if (lLocalTransaction){
lReturn.Trace("Transação local, instanciando banco...");
}
lInsert = new InsertCommand(NPJ_ALUNOXATENDIMENTOQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys){
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction);
if (!lReturn.HasError){
if (lLocalTransaction){
if (!lReturn.HasError){
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else{
lTransaction.Rollback();
}
}
}
else{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex){
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例2: Update
public static OperationResult Update(
DataFieldCollection pValues,
ConnectionInfo pInfo
)
{
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
OperationResult lReturn = new OperationResult(PaisQD.TableName, PaisQD.TableName);
ValidateUpdate(pValues, lReturn);
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(PaisQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de update");
foreach (DataField lField in pValues.Keys)
{
if ( (lField.Name != PaisQD._PS_ID.Name) )
lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", PaisQD._PS_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(PaisQD._PS_ID.Name, pValues[PaisQD._PS_ID].DBToDecimal());
lReturn.Trace("Executando o Update");
lUpdate.Execute(pTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Update finalizado, executando commit");
pTransaction.Commit();
}
else
{
pTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
pTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
pTransaction.Rollback();
}
}
return lReturn;
}
示例3: Insert
public static OperationResult Insert(
DataFieldCollection pValues,
Transaction pTransaction,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
bool lLocalTransaction = (pTransaction == null);
if (lLocalTransaction)
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
else
lTransaction = pTransaction;
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(InteressadoQD.TableName, InteressadoQD.TableName);
if (!lReturn.HasError)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lInsert = new InsertCommand(InteressadoQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "INTE_ID");
lInsert.Fields.Add(InteressadoQD._INTE_ID.Name, lSequence, (ItemType)InteressadoQD._INTE_ID.DBType);
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例4: Exluir_ByNUC_ID
public static OperationResult Exluir_ByNUC_ID(
decimal pNUC_ID,
ConnectionInfo pInfo
)
{
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
OperationResult lReturn = new OperationResult(NucleoxAreaAtuacaoQD.TableName, NucleoxAreaAtuacaoQD.TableName);
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(NucleoxAreaAtuacaoQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de update");
lUpdate.Fields.Add(NucleoxAreaAtuacaoQD._NUCARATUA_STATUS.Name, "I", (ItemType)NucleoxAreaAtuacaoQD._NUCARATUA_STATUS.DBType);
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", NucleoxAreaAtuacaoQD._NUC_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(NucleoxAreaAtuacaoQD._NUC_ID.Name, pNUC_ID);
lReturn.Trace("Executando o Update");
lUpdate.Execute(pTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Update finalizado, executando commit");
pTransaction.Commit();
}
else
{
pTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
pTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
pTransaction.Rollback();
}
}
return lReturn;
}
示例5: Insert
public static OperationResult Insert(
DataFieldCollection pValues,
List<DataFieldCollection> pListInterrupcao,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (lTransaction != null);
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(DCALC_CONDENACAOQD.TableName, DCALC_CONDENACAOQD.TableName);
if (!lReturn.HasError)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lInsert = new InsertCommand(DCALC_CONDENACAOQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "COND_ID");
lInsert.Fields.Add(DCALC_CONDENACAOQD._COND_ID.Name, lSequence, (ItemType)DCALC_CONDENACAOQD._COND_ID.DBType);
decimal lCOND_ID = 0;
lCOND_ID = lReturn.SequenceControl;
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction);
if (!lReturn.HasError)
{
if (pListInterrupcao.Count > 0)
{
foreach (DataFieldCollection lFields in pListInterrupcao)
{
lFields.Add(DCALC_INTERRUPCAOQD._COD_CONDENACAO, lSequence);
lReturn = DCALC_INTERRUPCAODo.Insert(lFields, lTransaction, pInfo);
if (lReturn.HasError)
{
lTransaction.Rollback();
return lReturn;
}
}
}
if (!lReturn.HasError)
{
lReturn.SequenceControl = lSequence;
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例6: Insert
public static OperationResult Insert(
DataFieldCollection pValues,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (lTransaction != null);
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(OficioQD.TableName, OficioQD.TableName);
if (!lReturn.HasError)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lInsert = new InsertCommand(OficioQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "OFC_ID");
lInsert.Fields.Add(OficioQD._OFC_ID.Name, lSequence, (ItemType)OficioQD._OFC_ID.DBType);
string lNumeroOficio = "OFC" + lSequence.ToString().PadLeft(7, '0') + "/" + DateTime.Now.Date.Year.ToString();
lInsert.Fields.Add(OficioQD._OFC_NUMERO.Name, lNumeroOficio, (ItemType)OficioQD._OFC_NUMERO.DBType);
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction, false);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例7: Insert
public static OperationResult Insert(
DataFieldCollection pValues,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (lTransaction != null);
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(TriagemQD.TableName, TriagemQD.TableName);
if (!lReturn.HasError)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lInsert = new InsertCommand(TriagemQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "TRG_ID");
lInsert.Fields.Add(TriagemQD._TRG_ID.Name, lSequence, (ItemType)TriagemQD._TRG_ID.DBType);
lReturn.SequenceControl = lSequence;
decimal lSequenceSenha;
if (pValues[TriagemQD._ASTTRG_ID].ToString() == "1")
{
lSequenceSenha = DataBaseSequenceControl.GetNext(lTransaction, TriagemQD.TableName, "TRG_SENHA", " NUC_ID = " + pValues[TriagemQD._NUC_ID] + " AND TO_CHAR(TRG_REGDATE,'dd/MM/yyyy') = TO_CHAR(SYSDATE,'dd/MM/yyyy') AND ASTTRG_ID = 1 AND TRG_PRIORIDADE = " + pValues[TriagemQD._TRG_PRIORIDADE]);
lInsert.Fields.Add(TriagemQD._TRG_SENHA.Name, lSequenceSenha, (ItemType)TriagemQD._TRG_SENHA.DBType);
}
else if (pValues[TriagemQD._ASTTRG_ID].ToString() == "4")
{
lSequenceSenha = DataBaseSequenceControl.GetNext(lTransaction, TriagemQD.TableName, "TRG_SENHA", " NUC_ID = " + pValues[TriagemQD._NUC_ID] + " AND TO_CHAR(TRG_REGDATE,'dd/MM/yyyy') = TO_CHAR(SYSDATE,'dd/MM/yyyy') AND ASTTRG_ID = 4 AND TRG_PRIORIDADE = " + pValues[TriagemQD._TRG_PRIORIDADE]);
lInsert.Fields.Add(TriagemQD._TRG_SENHA.Name, lSequenceSenha, (ItemType)TriagemQD._TRG_SENHA.DBType);
}
else if (pValues[TriagemQD._ASTTRG_ID].ToString() == "7")
{
lSequenceSenha = DataBaseSequenceControl.GetNext(lTransaction, TriagemQD.TableName, "TRG_SENHA", " NUC_ID = " + pValues[TriagemQD._NUC_ID] + " AND TO_CHAR(TRG_REGDATE,'dd/MM/yyyy') = TO_CHAR(SYSDATE,'dd/MM/yyyy') AND ASTTRG_ID = 7 AND TRG_PRIORIDADE = " + pValues[TriagemQD._TRG_PRIORIDADE]);
lInsert.Fields.Add(TriagemQD._TRG_SENHA.Name, lSequenceSenha, (ItemType)TriagemQD._TRG_SENHA.DBType);
}
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例8: Update
public static OperationResult Update(
DataFieldCollection pValues,
ConnectionInfo pInfo
)
{
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
OperationResult lReturn = new OperationResult(NucleoQD.TableName, NucleoQD.TableName);
ValidateUpdate(pValues, lReturn);
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
//16/10/2012 Ricardo Almeida - retirada da função, pois registro não pode ser excluido se estiver usuário cadastrado
//lReturn = NucleoxAreaAtuacaoDo.Exluir_ByNUC_ID(pValues[NucleoQD._NUC_ID].DBToDecimal(), pInfo);
//if (lReturn.HasError)
//{
// if (lLocalTransaction)
// pTransaction.Rollback();
// return lReturn;
//}
lReturn = NucleoxSecretariaDo.Exluir_ByNUC_ID(pValues[NucleoQD._NUC_ID].DBToDecimal(), pInfo);
if (!lReturn.HasError)
{
lUpdate = new UpdateCommand(NucleoQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de update");
foreach (DataField lField in pValues.Keys)
{
if ((lField.Name != NucleoQD._NUC_ID.Name))
lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", NucleoQD._NUC_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(NucleoQD._NUC_ID.Name, pValues[NucleoQD._NUC_ID].DBToDecimal());
lReturn.Trace("Executando o Update");
lUpdate.Execute(pTransaction);
}
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Update finalizado, executando commit");
pTransaction.Commit();
}
else
{
pTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
pTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
pTransaction.Rollback();
}
}
return lReturn;
}
示例9: Insert
public static OperationResult Insert(
DataFieldCollection pValues,
Transaction pTransaction,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
bool lLocalTransaction = (pTransaction == null);
if (lLocalTransaction)
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
else
lTransaction = pTransaction;
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(AtuacaoQD.TableName, AtuacaoQD.TableName);
if (!lReturn.HasError)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
//lReturn.Trace("Excluído Atuações...");
//lReturn = UpdateInativo(pValues[AtuacaoQD._PESF_ID].DBToDecimal(), pValues[AtuacaoQD._ATUA_STATUS].ToString(), pInfo);
//if (lReturn.HasError)
//{
// return lReturn;
//}
lInsert = new InsertCommand(AtuacaoQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de insert");
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "ATUA_ID");
lInsert.Fields.Add(AtuacaoQD._ATUA_ID.Name, lSequence, (ItemType)AtuacaoQD._ATUA_ID.DBType);
lReturn.SequenceControl = lSequence;
lReturn.Trace("Executando o Insert");
lInsert.Execute(lTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例10: InsertPeticao
public static OperationResult InsertPeticao(
DataFieldCollection pValuesDocMovAddPeticao,
DataFieldCollection pValuesPeticao,
DataFieldCollection pValuesDocMovTram,
DataFieldCollection pValuesTramitacao,
ConnectionInfo pInfo
)
{
Transaction lTransaction;
lTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (lTransaction != null);
InsertCommand lInsert;
OperationResult lReturn = new OperationResult(DocumentoMovimentoQD.TableName, DocumentoMovimentoQD.TableName);
decimal lPTC_ID = 0;
decimal lDOCMOV = 0;
if (!lReturn.HasError)
{
try
{
lReturn = DocumentoMovimentoDo.Insert(pValuesDocMovAddPeticao, lTransaction, pInfo);
if (lReturn.HasError)
{
lTransaction.Rollback();
return lReturn;
}
lReturn = PeticaoDo.Insert(pValuesPeticao, lTransaction, pInfo);
if (lReturn.HasError)
{
lTransaction.Rollback();
return lReturn;
}
lPTC_ID = lReturn.SequenceControl;
pValuesDocMovTram.Add(DocumentoMovimentoQD._PTC_ID, lPTC_ID);
lReturn = DocumentoMovimentoDo.Insert(pValuesDocMovTram, lTransaction, pInfo);
if (lReturn.HasError)
{
lTransaction.Rollback();
return lReturn;
}
lDOCMOV = lReturn.SequenceControl;
pValuesTramitacao.Add(DocumentoTramitacaoQD._DOCMOV_ID, lDOCMOV);
lReturn = DocumentoTramitacaoDo.Insert(pValuesTramitacao, lTransaction, pInfo);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("Insert finalizado, executando commit");
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
lReturn.SequenceControl = lPTC_ID;
return lReturn;
}