本文整理汇总了C#中APB.Mercury.DataObjects.DefNpj.OperationResult类的典型用法代码示例。如果您正苦于以下问题:C# OperationResult类的具体用法?C# OperationResult怎么用?C# OperationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationResult类属于APB.Mercury.DataObjects.DefNpj命名空间,在下文中一共展示了OperationResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateDecimal
private static void ValidateDecimal(string pFieldName, object pValue, OperationResult pOperationResult)
{
decimal lResult;
if (!Decimal.TryParse(pValue.ToString(), out lResult))
{
pOperationResult.InvalidField(pFieldName, "Invalid", pValue);
}
}
示例2: ValidateDate
private static void ValidateDate(string pFieldName, object pValue, OperationResult pOperationResult)
{
DateTime lResult;
if (pValue.GetType() == typeof(DateTime)) return;
if (!DateTime.TryParse(pValue.ToString(), out lResult))
{
pOperationResult.InvalidField(pFieldName, "Invalid", pValue);
}
}
示例3: 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;
}
示例4: GetNext
public static decimal GetNext(Transaction pTransaction, string pIDFieldValue)
{
decimal lID;
// Inicializa operação
OperationResult lReturn = new OperationResult(QueryDictionaries.SequencesQD.TableName, QueryDictionaries.SequencesQD.TableName);
// Recupera Valor
SelectCommand lSelectNext;
string lSelectQuery = QueryDictionaries.SequencesQD.qSequencesMax;
lSelectQuery += String.Format("WHERE {0} = >>{0}", QueryDictionaries.SequencesQD._SEQ_NAME.Name);
object lScalarReturn;
lSelectNext = new SelectCommand(lSelectQuery);
// Passagem dos Valores de Parametros para a Clausula WHERE [comando SELECT]
lSelectNext.Fields.Add(QueryDictionaries.SequencesQD._SEQ_NAME.Name, pIDFieldValue, ItemType.String);
// Recupera Valor do Select (Seq_Value)
lScalarReturn = lSelectNext.ReturnScalar(pTransaction);
if (lScalarReturn == null || lScalarReturn == DBNull.Value) lScalarReturn = 1;
lID = Convert.ToDecimal(lScalarReturn);
// Altera Valor da Sequence
UpdateCommand lUpdate;
lUpdate = new UpdateCommand(QueryDictionaries.SequencesQD.TableName);
// Identificação dos Campos a serem Alterados
lUpdate.Fields.Add(QueryDictionaries.SequencesQD._SEQ_VALUE.Name, lID, (ItemType) QueryDictionaries.SequencesQD._SEQ_VALUE.DBType);
string lUpdateQuery;
lUpdateQuery = String.Format("WHERE {0} = >>{0}", QueryDictionaries.SequencesQD._SEQ_NAME.Name);
lUpdate.Condition = lUpdateQuery;
// Passagem dos Valores para a Condição Where do Update
lUpdate.Conditions.Add(QueryDictionaries.SequencesQD._SEQ_NAME.Name, pIDFieldValue);
// Execução do UPDATE
lUpdate.Execute(pTransaction);
// Retorna novo valor da chave [SEQUENCE VALUE]
return lID;
}
示例5: ValidateRequired
public static void ValidateRequired(DataField pField, DataFieldCollection pValues, OperationResult pOperationResult)
{
if (!pValues.ContainsKey(pField))
{
pOperationResult.InvalidField(pField.Name, "Required", null);
}
else
{
if (pValues[pField] == null)
{
pOperationResult.InvalidField(pField.Name, "Required", null);
}
else
{
if (pValues[pField].ToString() == "")
pOperationResult.InvalidField(pField.Name, "Required", null);
}
}
}
示例6: ValidateConversion
public static void ValidateConversion(DataFieldCollection pValues, OperationResult pOperationResult)
{
foreach (DataField lField in pValues.Keys)
{
switch (lField.DBType)
{
case 0:
ValidateDecimal(lField.Name, pValues[lField], pOperationResult);
break;
case 2:
ValidateDate(lField.Name, pValues[lField], pOperationResult);
break;
}
}
}
示例7: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(SituacaoEscolarQD._STESC_ID, pValues, pResult);
}
示例8: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(NPJ_ALUNOXATENDIMENTOQD._DOC_ID, pValues, pResult);
GenericDataObject.ValidateRequired(NPJ_ALUNOXATENDIMENTOQD._SUSR_ID, pValues, pResult);
//GenericDataObject.ValidateRequired(NPJ_ALUNOXATENDIMENTOQD._SIT_ID, pValues, pResult);
}
示例9: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(MedidasCriminalQD._MDCRM_ID, pValues, pResult);
GenericDataObject.ValidateRequired(MedidasCriminalQD._MDCRM_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(MedidasCriminalQD._MDCRM_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(MedidasCriminalQD._MDCRM_STATUS , pValues, pResult);
}
示例10: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(SEG_USUARIOXGRUPOQD._GRP_ID, pValues, pResult);
GenericDataObject.ValidateRequired(SEG_USUARIOXGRUPOQD._SUSR_ID, pValues, pResult);
GenericDataObject.ValidateRequired(SEG_USUARIOXGRUPOQD._SUSR_REGSTATUS, pValues, pResult);
}
示例11: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(SEG_GRUPOXPROGRAMAQD._GRP_ID, pValues, pResult);
GenericDataObject.ValidateRequired(SEG_GRUPOXPROGRAMAQD._PRO_ID, pValues, pResult);
GenericDataObject.ValidateRequired(SEG_GRUPOXPROGRAMAQD._GRP_REGSTATUS, pValues, pResult);
}
示例12: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(DCALC_CONDENACAOQD._COND_ID, pValues, pResult);
}
示例13: 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(SituacaoFamiliarResideQD.TableName, SituacaoFamiliarResideQD.TableName);
if (!lReturn.HasError)
{
try
{
lInsert = new InsertCommand(SituacaoFamiliarResideQD.TableName);
foreach (DataField lField in pValues.Keys)
{
lInsert.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
decimal lSequence;
lSequence = DataBaseSequenceControl.GetNext(pInfo, "STFRES_ID");
lInsert.Fields.Add(SituacaoFamiliarResideQD._STFRES_ID.Name, lSequence, (ItemType)SituacaoFamiliarResideQD._STFRES_ID.DBType);
lInsert.Execute(lTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lTransaction.Commit();
}
else
{
lTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
lTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
lTransaction.Rollback();
}
}
return lReturn;
}
示例14: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(SituacaoFamiliarResideQD._STFAM_ID, pValues, pResult);
}
示例15: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(DocumentoxEETipoAcaoQD._DOCEETPAC_ID, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEETipoAcaoQD._DOCEETPAC_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEETipoAcaoQD._DOCEETPAC_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEETipoAcaoQD._DOCEETPAC_STATUS , pValues, pResult);
}