本文整理汇总了C#中APB.Mercury.DataObjects.SCPWeb.OperationResult类的典型用法代码示例。如果您正苦于以下问题:C# OperationResult类的具体用法?C# OperationResult怎么用?C# OperationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationResult类属于APB.Mercury.DataObjects.SCPWeb命名空间,在下文中一共展示了OperationResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:9,代码来源:GenericDataObject.cs
示例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);
}
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:11,代码来源:GenericDataObject.cs
示例3: 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;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:47,代码来源:DataBaseSequence.cs
示例4: 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);
}
}
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:19,代码来源:GenericDataObject.cs
示例5: 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;
}
}
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:20,代码来源:GenericDataObject.cs
示例6: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(AssuntoProcessualQD._ASSPRC_ID, pValues, pResult);
GenericDataObject.ValidateRequired(AssuntoProcessualQD._ASSPRC_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(AssuntoProcessualQD._ASSPRC_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(AssuntoProcessualQD._ASSPRC_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:AssuntoProcessualDo.cs
示例7: 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(AssuntoProcessualQD.TableName, AssuntoProcessualQD.TableName);
ValidateUpdate(pValues, lReturn);
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(AssuntoProcessualQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de update");
foreach (DataField lField in pValues.Keys)
{
if ((lField.Name != AssuntoProcessualQD._ASSPRC_ID.Name))
lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", AssuntoProcessualQD._ASSPRC_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(AssuntoProcessualQD._ASSPRC_ID.Name, pValues[AssuntoProcessualQD._ASSPRC_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;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:77,代码来源:AssuntoProcessualDo.cs
示例8: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(CasaPenalQD._CSP_ID, pValues, pResult);
GenericDataObject.ValidateRequired(CasaPenalQD._CSP_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(CasaPenalQD._CSP_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(CasaPenalQD._CSP_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:CasaPenalDo.cs
示例9: 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(NucleoxSecretariaQD.TableName, NucleoxSecretariaQD.TableName);
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(NucleoxSecretariaQD.TableName);
lReturn.Trace("Adicionando campos ao objeto de update");
lUpdate.Fields.Add(NucleoxSecretariaQD._NUCSCT_STATUS.Name, "I", (ItemType)NucleoxSecretariaQD._NUCSCT_STATUS.DBType);
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", NucleoxSecretariaQD._NUC_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(NucleoxSecretariaQD._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;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:72,代码来源:NucleoxSecretariaDo.cs
示例10: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(UnidadeVaraInfracionalQD._UVI_ID, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:4,代码来源:UnidadeVaraInfracionalDo.cs
示例11: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(NucleoxAreaAtuacaoQD._NUCARATUA_ID, pValues, pResult);
GenericDataObject.ValidateRequired(NucleoxAreaAtuacaoQD._NUCARATUA_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(NucleoxAreaAtuacaoQD._NUCARATUA_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(NucleoxAreaAtuacaoQD._NUCARATUA_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:NucleoxAreaAtuacaoDo.cs
示例12: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(ALUNOXATENDIMENTONPJQD._AAN_ID, pValues, pResult);
GenericDataObject.ValidateRequired(ALUNOXATENDIMENTONPJQD._AAN_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(ALUNOXATENDIMENTONPJQD._AAN_USUARIO, pValues, pResult);
GenericDataObject.ValidateRequired(ALUNOXATENDIMENTONPJQD._AAN_STATUS , pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:ALUNOXATENDIMENTONPJDo.cs
示例13: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(TipoOficioQD._TPOFC_ID, pValues, pResult);
GenericDataObject.ValidateRequired(TipoOficioQD._TPOFC_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(TipoOficioQD._TPOFC_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(TipoOficioQD._TPOFC_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:TipoOficioDo.cs
示例14: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(SystemUserQD._SUSR_ID, pValues, pResult);
GenericDataObject.ValidateRequired(SystemUserQD._SUSR_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(SystemUserQD._SUSR_REGUSR, pValues, pResult);
GenericDataObject.ValidateRequired(SystemUserQD._SUSR_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:10,代码来源:SystemUserDo.cs
示例15: ChangePassword
public static string ChangePassword(decimal pSusr_Id, string pSusr_Login, string pSusr_Password_old, string pSusr_Password_new, ConnectionInfo pConnectionInfo)
{
bool lPasswordOK;
string lPassword;
string lResult = "";
OperationResult lReturn;
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pConnectionInfo));
// Validando a Senha Digitada.
lPassword = GetPassword(pSusr_Login, pConnectionInfo);
lPasswordOK = (lPassword == pSusr_Password_old) ? true : false;
if (!lPasswordOK)
lResult = "Senha Atual Incorreta";
// Verificando Transação
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
lReturn = new OperationResult(SystemUserQD.TableName, SystemUserQD.TableName);
if (lPasswordOK)
{
// Iniciando processo de update...
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("ExternalUser: Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(SystemUserQD.TableName);
lReturn.Trace("ExternalUser: Adicionando campos ao objeto de update");
lUpdate.Fields.Add(SystemUserQD._SUSR_PASSWORD.Name, APB.Framework.Encryption.Crypto.Encode(pSusr_Password_new), (ItemType)SystemUserQD._SUSR_PASSWORD.DBType);
string lSql = "";
//TODO: Condição where customizada
lSql = String.Format("WHERE {0} = >>{0}", SystemUserQD._SUSR_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(SystemUserQD._SUSR_ID.Name, pSusr_Id);
lReturn.Trace("ExternalUser: Executando o Update");
lUpdate.Execute(pTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("ExternalUser: 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();
}
}
}
else
{
return "Senha atual incorreta";
}
if (lReturn.IsValid)
lResult = "";
else
lResult = lReturn.ToString();
return lResult;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:96,代码来源:SystemUserDo.cs
示例16: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(CalendarioJuridicoQD._CLDJ_ID, pValues, pResult);
GenericDataObject.ValidateRequired(CalendarioJuridicoQD._CLDJ_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(CalendarioJuridicoQD._CLDJ_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(CalendarioJuridicoQD._CLDJ_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:CalendarioJuridicoDo.cs
示例17: UpdateByNucleoArea
public static OperationResult UpdateByNucleoArea(
DataFieldCollection pValues,
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");
foreach (DataField lField in pValues.Keys)
{
if ((lField.Name != NucleoxAreaAtuacaoQD._NUC_ID.Name) && (lField.Name != NucleoxAreaAtuacaoQD._ARATUA_ID.Name))
lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
string lSql = "";
lSql = String.Format("WHERE {0} = >>{0} AND {1} = >>{1} AND {2} = >>{2}", NucleoxAreaAtuacaoQD._NUC_ID.Name, NucleoxAreaAtuacaoQD._ARATUA_ID.Name, NucleoxAreaAtuacaoQD._NUCARATUA_STATUS.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(NucleoxAreaAtuacaoQD._NUC_ID.Name, pValues[NucleoxAreaAtuacaoQD._NUC_ID].DBToDecimal());
lUpdate.Conditions.Add(NucleoxAreaAtuacaoQD._ARATUA_ID.Name, pValues[NucleoxAreaAtuacaoQD._ARATUA_ID].DBToDecimal());
lUpdate.Conditions.Add(NucleoxAreaAtuacaoQD._NUCARATUA_STATUS.Name, pValues[NucleoxAreaAtuacaoQD._NUCARATUA_STATUS].ToString());
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;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:77,代码来源:NucleoxAreaAtuacaoDo.cs
示例18: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(DocumentoxAssuntoPsicossocialQD._DOCASSPS_ID, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxAssuntoPsicossocialQD._DOCASSPS_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxAssuntoPsicossocialQD._DOCASSPS_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxAssuntoPsicossocialQD._DOCASSPS_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:DocumentoxAssuntoPsicossocialDo.cs
示例19: ValidateUpdate
private static void ValidateUpdate(DataFieldCollection pValues, OperationResult pResult)
{
GenericDataObject.ValidateRequired(DocumentoxEEDestinoQD._DOCEEDST_ID, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEEDestinoQD._DOCEEDST_REGDATE, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEEDestinoQD._DOCEEDST_REGUSER, pValues, pResult);
GenericDataObject.ValidateRequired(DocumentoxEEDestinoQD._DOCEEDST_STATUS, pValues, pResult);
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:7,代码来源:DocumentoxEEDestinoDo.cs
示例20: Update
public static OperationResult Update(
DataFieldCollection pValues,
List<DataFieldCollection> pListValuesSFR,
DataFieldCollection pValuesSFRExcluir,
ConnectionInfo pInfo
)
{
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pInfo));
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
OperationResult lReturn = new OperationResult(SituacaoFamiliarQD.TableName, SituacaoFamiliarQD.TableName);
ValidateUpdate(pValues, lReturn);
if (lReturn.IsValid)
{
try
{
lUpdate = new UpdateCommand(SituacaoFamiliarQD.TableName);
foreach (DataField lField in pValues.Keys)
{
if ((lField.Name != SituacaoFamiliarQD._PES_ID.Name) && (lField.Name != SituacaoFamiliarQD._STFAM_ID.Name))
lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
}
string lSql = "";
lSql = String.Format("WHERE {0} = <<{0}", SituacaoFamiliarQD._PES_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(SituacaoFamiliarQD._PES_ID.Name, pValues[SituacaoFamiliarQD._PES_ID].DBToDecimal());
lUpdate.Execute(pTransaction);
if (!lReturn.HasError)
{
if (pListValuesSFR.Count > 0)
{
//1º Exclui todos os registros ja salvos
lReturn = SituacaoFamiliarResideDo.ExcluirTodos(pValuesSFRExcluir, pTransaction, pInfo);
if (lReturn.HasError)
{
pTransaction.Rollback();
return lReturn;
}
//2º inclui os novos registros
foreach (DataFieldCollection lFields in pListValuesSFR)
{
lFields.Add(SituacaoFamiliarResideQD._STFAM_ID, pValues[SituacaoFamiliarQD._STFAM_ID].DBToDecimal());
lReturn = SituacaoFamiliarResideDo.Insert(lFields, pTransaction, pInfo);
if (lReturn.HasError)
{
pTransaction.Rollback();
return lReturn;
}
}
}
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
pTransaction.Commit();
}
else
{
pTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
pTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
pTransaction.Rollback();
}
}
return lReturn;
}
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:96,代码来源:SituacaoFamiliarDo.cs
注:本文中的APB.Mercury.DataObjects.SCPWeb.OperationResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论