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


C# OperationResult.Trace方法代码示例

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


在下文中一共展示了OperationResult.Trace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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(AssuntoProcessualQD.TableName, AssuntoProcessualQD.TableName);

            if (!lReturn.HasError)
            {
                try
                {
                    if (lLocalTransaction)
                    {
                        lReturn.Trace("Transação local, instanciando banco...");
                    }

                    lInsert = new InsertCommand(AssuntoProcessualQD.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, "ASSPRC_ID");
                    lInsert.Fields.Add(AssuntoProcessualQD._ASSPRC_ID.Name, lSequence, (ItemType)AssuntoProcessualQD._ASSPRC_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;
        }
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:73,代码来源:AssuntoProcessualDo.cs

示例3: 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

示例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(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

示例5: 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

示例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(DocumentoQD.TableName, DocumentoQD.TableName);

            if (!lReturn.HasError)
            {
                try
                {
                    if (lLocalTransaction)
                    {
                        lReturn.Trace("Transação local, instanciando banco...");
                    }

                    lInsert = new InsertCommand(DocumentoQD.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, "DOC_ID");
                    lInsert.Fields.Add(DocumentoQD._DOC_ID.Name, lSequence, (ItemType)DocumentoQD._DOC_ID.DBType);

                    lReturn.SequenceControl = lSequence;

                    decimal lDocNumero = 0;
                    string lNumeroDocumento = "";

                    if (pValues[DocumentoQD._TDOC_ID].DBToDecimal() == 1)
                    {
                        lDocNumero = DataBaseSequenceControl.GetNext(pInfo, "DOC_ATENDIMENTO");

                        if (System.Configuration.ConfigurationManager.AppSettings["ApplicationMode"].ToString() == "OnLine")
                            lNumeroDocumento = "A" + pValues[DocumentoQD._NUC_ID].ToString().PadLeft(2,'0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                        else
                            lNumeroDocumento = "T" + pValues[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                    }
                    else if (pValues[DocumentoQD._TDOC_ID].DBToDecimal() == 2)
                    {
                        lDocNumero = DataBaseSequenceControl.GetNext(pInfo, "DOC_NUMERO");

                        if (System.Configuration.ConfigurationManager.AppSettings["ApplicationMode"].ToString() == "OnLine")
                            lNumeroDocumento = "P" + pValues[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                        else
                            lNumeroDocumento = "R" + pValues[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                    }

                    lInsert.Fields.Add(DocumentoQD._DOC_NUMERO.Name, lNumeroDocumento, (ItemType)DocumentoQD._DOC_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;
        }
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:99,代码来源:DocumentoDo.cs

示例7: InsertProcesso

        public static OperationResult InsertProcesso(
                DataFieldCollection pValuesAgendamentoDefensor,
                DataFieldCollection pValuesAtendimento,
                List<DataFieldCollection> pListDocumentoMovimentoAtendimento,
                DataFieldCollection pValuesProcesso,
                List<DataFieldCollection> pListAssuntoProcessual,
                List<DataFieldCollection> pListInteressado,
                DataFieldCollection pValuesDocMovTramitacao,
                List<DataFieldCollection> pListDocumentoMovimentoProcesso,
                DataFieldCollection pValuesTramitacao,
                DataFieldCollection pValuesDocMovAnexo,
                DataFieldCollection pValuesAnexoExterno,
                DataFieldCollection pValuesDocMovApf,
                DataFieldCollection pValuesAnexoApf,
                DataFieldCollection pValuesDocMovSiscop,
                DataFieldCollection pValuesAnexoSiscop,
                DataFieldCollection pValuesCriminalDatas,
             ConnectionInfo pInfo
         )
        {
            Transaction lTransaction;

            lTransaction = new Transaction(Instance.CreateDatabase(pInfo));

            bool lLocalTransaction = (lTransaction != null);

            InsertCommand lInsert;

            OperationResult lReturn = new OperationResult(DocumentoQD.TableName, DocumentoQD.TableName);

            if (!lReturn.HasError)
            {
                try
                {
                    if (lLocalTransaction)
                    {
                        lReturn.Trace("Transação local, instanciando banco...");
                    }

                    lInsert = new InsertCommand(DocumentoQD.TableName);

                    lReturn.Trace("Adicionando campos ao objeto de insert");

                    foreach (DataField lField in pValuesProcesso.Keys)
                    {
                        lInsert.Fields.Add(lField.Name, pValuesProcesso[lField], (ItemType)lField.DBType);
                    }
                    decimal lSequence;
                    lSequence = DataBaseSequenceControl.GetNext(pInfo, "DOC_ID");
                    lInsert.Fields.Add(DocumentoQD._DOC_ID.Name, lSequence, (ItemType)DocumentoQD._DOC_ID.DBType);

                    lReturn.SequenceControl = lSequence;

                    decimal lDocNumero = 0;
                    string lNumeroDocumento = "";

                    if (pValuesProcesso[DocumentoQD._TDOC_ID].DBToDecimal() == 1)
                    {
                        lDocNumero = DataBaseSequenceControl.GetNext(pInfo, "DOC_ATENDIMENTO");

                        if (System.Configuration.ConfigurationManager.AppSettings["ApplicationMode"].ToString() == "OnLine")
                            lNumeroDocumento = "A" + pValuesProcesso[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                        else
                            lNumeroDocumento = "T" + pValuesProcesso[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                    }
                    else if (pValuesProcesso[DocumentoQD._TDOC_ID].DBToDecimal() == 2)
                    {
                        lDocNumero = DataBaseSequenceControl.GetNext(pInfo, "DOC_NUMERO");

                        if (System.Configuration.ConfigurationManager.AppSettings["ApplicationMode"].ToString() == "OnLine")
                            lNumeroDocumento = "P" + pValuesProcesso[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                        else
                            lNumeroDocumento = "R" + pValuesProcesso[DocumentoQD._NUC_ID].ToString().PadLeft(2, '0') + lDocNumero.ToString().PadLeft(5, '0') + "/" + DateTime.Now.Date.Year.ToString();
                    }

                    lInsert.Fields.Add(DocumentoQD._DOC_NUMERO.Name, lNumeroDocumento, (ItemType)DocumentoQD._DOC_NUMERO.DBType);

                    lReturn.Trace("Executando o Insert Documento");

                    lInsert.Execute(lTransaction, false);

                    if (!lReturn.HasError)
                    {

                        lReturn = AgendamentoDefensorDo.Update(pValuesAgendamentoDefensor, lTransaction, pInfo);
                        if (lReturn.HasError)
                        {
                            lTransaction.Rollback();
                            return lReturn;
                        }

                        lReturn = DocumentoDo.Update(pValuesAtendimento, lTransaction, pInfo);
                        if (lReturn.HasError)
                        {
                            lTransaction.Rollback();
                            return lReturn;
                        }

                        if (pListDocumentoMovimentoAtendimento.Count > 0)
                        {
//.........这里部分代码省略.........
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:101,代码来源:DocumentoDo.cs

示例8: 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(PeticaoQD.TableName, PeticaoQD.TableName);

            if (!lReturn.HasError)
            {
                try
                {
                    if (lLocalTransaction)
                    {
                        lReturn.Trace("Transação local, instanciando banco...");
                    }

                    lInsert = new InsertCommand(PeticaoQD.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, "PTC_ID");
                    lInsert.Fields.Add(PeticaoQD._PTC_ID.Name, lSequence, (ItemType)PeticaoQD._PTC_ID.DBType);

                    string lNumeroPeticao = "PET" + lSequence.ToString().PadLeft(7, '0') + "/" + DateTime.Now.Date.Year.ToString();

                    lInsert.Fields.Add(PeticaoQD._PTC_NUMERO.Name, lNumeroPeticao, (ItemType)PeticaoQD._PTC_NUMERO.DBType);

                    lReturn.SequenceControl = lSequence;

                    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;
        }
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:83,代码来源:PeticaoDo.cs

示例9: 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;
        }
开发者ID:andreibaptista,项目名称:DEF_PUB_CALC,代码行数:92,代码来源:NucleoDo.cs


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