当前位置: 首页>>代码示例>>C#>>正文


C# SCPWeb.OperationResult类代码示例

本文整理汇总了C#中APB.Mercury.DataObjects.SCPWeb.OperationResult的典型用法代码示例。如果您正苦于以下问题:C# OperationResult类的具体用法?C# OperationResult怎么用?C# OperationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OperationResult类属于APB.Mercury.DataObjects.SCPWeb命名空间,在下文中一共展示了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);
            }
        }
开发者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


注:本文中的APB.Mercury.DataObjects.SCPWeb.OperationResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。