• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UpdateCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



UpdateCommand类属于命名空间,在下文中一共展示了UpdateCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: UpdateEntity_ShouldUpdateEntity

        public void UpdateEntity_ShouldUpdateEntity()
        {
            // arrange
            var obj = new Author { Uid = AuthorUid};
            var storageObj = new Author { Uid = AuthorUid };
            var stub = new FakeRepository(new Dictionary<Type, IEnumerable<IEntity>>
            {
                {typeof (Author), new[] {new Author {Uid = Guid.NewGuid()}, storageObj}}
            });
            var updateCommand = new UpdateCommand<Author>();

            // act
            obj.Name = "foo bar";
            obj.About = "sooo some foor";
            obj.Company = "rook";
            obj.SemanticUid = "foo_bar_rook";
            updateCommand.Entity = obj;
            updateCommand.Execute(stub);

            // assert
            Assert.AreEqual(obj.Name, storageObj.Name);
            Assert.AreEqual(obj.About, storageObj.About);
            Assert.AreEqual(obj.Company, storageObj.Company);
            Assert.AreEqual(obj.SemanticUid, storageObj.SemanticUid);
        }
开发者ID:dev2dev-community,项目名称:d2dsite,代码行数:25,代码来源:UpdateCommandTest.cs


示例2: Disable

        public async Task<CodeFeatureModel> Disable(string codeFeatureId)
        {
            var updateCommand = new UpdateCommand(codeFeatureId, false);

            await _updateCommandHandler.Execute(updateCommand);

            return new CodeFeatureModel
            {
                CodeFeatureId = updateCommand.CodeFeatureId,
                Enabled = updateCommand.Enabled,
            };
        }
开发者ID:modulexcite,项目名称:Fooidity,代码行数:12,代码来源:CodeFeatureController.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_PETICOES,代码行数:47,代码来源:DataBaseSequence.cs


示例4: Update

        public static OperationResult Update(
            DataFieldCollection pValues,
            List<DataFieldCollection> pListAtuaInc,
            List<DataFieldCollection> pListAtuaUpd,
            DataFieldCollection pValuesAtuaExcluir,
            List<DataFieldCollection> pListPermissao,
            ConnectionInfo pInfo
        )
        {
            Transaction pTransaction;

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

            bool lLocalTransaction = (pTransaction != null);

            UpdateCommand lUpdate;

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

            ValidateUpdate(pValues, lReturn);

            if (lReturn.IsValid)
            {
                try
                {
                    lUpdate = new UpdateCommand(PessoaFuncaoQD.TableName);

                    foreach (DataField lField in pValues.Keys)
                    {
                        if ((lField.Name != PessoaFuncaoQD._PESF_ID.Name))
                            lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
                    }

                    string lSql = "";
                    lSql = String.Format("WHERE {0} = <<{0}", PessoaFuncaoQD._PESF_ID.Name);
                    lUpdate.Condition = lSql;
                    lUpdate.Conditions.Add(PessoaFuncaoQD._PESF_ID.Name, pValues[PessoaFuncaoQD._PESF_ID].DBToDecimal());

                    lUpdate.Execute(pTransaction);

                    if (!lReturn.HasError)
                    {
                        //Excluir atuação do núcleo alterado
                        if (pValuesAtuaExcluir.Count > 0)
                        {
                            lReturn = AtuacaoDo.UpdateInativo(pValuesAtuaExcluir, pInfo);

                            if (lReturn.HasError)
                            {
                                pTransaction.Rollback();
                                return lReturn;
                            }
                        }

                        if (pListAtuaInc.Count > 0)
                        {
                            foreach (DataFieldCollection lFields in pListAtuaInc)
                            {
                                lReturn = AtuacaoDo.Insert(lFields, pTransaction, pInfo);

                                if (lReturn.HasError)
                                {
                                    pTransaction.Rollback();
                                    return lReturn;
                                }
                            }
                        }

                        if (pListAtuaUpd.Count > 0)
                        {
                            foreach (DataFieldCollection lFields in pListAtuaUpd)
                            {
                                lReturn = AtuacaoDo.Update(lFields, pTransaction, pInfo);

                                if (lReturn.HasError)
                                {
                                    pTransaction.Rollback();
                                    return lReturn;
                                }
                            }
                        }

                        if (pListPermissao.Count > 0)
                        {
                            foreach (DataFieldCollection lFields in pListPermissao)
                            {
                                lReturn = SecurityUsersDtDo.Insert(lFields, pTransaction, pInfo);

                                if (lReturn.HasError)
                                {
                                    pTransaction.Rollback();
                                    return lReturn;
                                }
                            }
                        }

                        if (!lReturn.HasError)
                        {
                            pTransaction.Commit();
                        }
//.........这里部分代码省略.........
开发者ID:andreibaptista,项目名称:DEF_PUB_PORTAL,代码行数:101,代码来源:PessoaFuncaoDo.cs


示例5: ZipUpdate

			public ZipUpdate(UpdateCommand command, ZipEntry entry)
			{
				command_ = command;
				entry_ = ( ZipEntry )entry.Clone();
			}
开发者ID:jamesbascle,项目名称:SharpZipLib,代码行数:5,代码来源:ZipFile.cs


示例6: BlubbUpdate

			public BlubbUpdate( UpdateCommand command, BlubbZipEntry entry ) {
				command_ = command;
				entry_ = (BlubbZipEntry)entry.Clone();
			}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:4,代码来源:BlubbZipFile.cs


示例7: ZipUpdate

			public ZipUpdate(UpdateCommand command, ZipEntry entry)
			{
				command_ = command;
				entry_ = ( ZipEntry )entry.Clone();
#if FORCE_ZIP64
				entry_.ForceZip64();
#endif
			}
开发者ID:jiangguang5201314,项目名称:VMukti,代码行数:8,代码来源:ZipFile.cs


示例8: GetUpdateExpression

        public override Expression GetUpdateExpression(MappingEntity entity, Expression instance, LambdaExpression updateCheck, LambdaExpression selector, Expression @else)
        {
            var tableAlias = new TableAlias();
            var table = new TableExpression(tableAlias, entity, this.mapping.GetTableName(entity));

            var where = this.GetIdentityCheck(table, entity, instance);
            if (updateCheck != null)
            {
                Expression typeProjector = this.GetEntityExpression(table, entity);
                Expression pred = DbExpressionReplacer.Replace(updateCheck.Body, updateCheck.Parameters[0], typeProjector);
                where = where.And(pred);
            }

            var assignments = this.GetColumnAssignments(table, instance, entity, (e, m) => this.mapping.IsUpdatable(e, m));

            Expression update = new UpdateCommand(table, where, assignments);

            if (selector != null)
            {
                return new BlockCommand(
                    update,
                    new IFCommand(
                        this.translator.Linguist.Language.GetRowsAffectedExpression(update).GreaterThan(Expression.Constant(0)),
                        this.GetUpdateResult(entity, instance, selector),
                        @else
                        )
                    );
            }
            else if (@else != null)
            {
                return new BlockCommand(
                    update,
                    new IFCommand(
                        this.translator.Linguist.Language.GetRowsAffectedExpression(update).LessThanOrEqual(Expression.Constant(0)),
                        @else,
                        null
                        )
                    );
            }
            else
            {
                return update;
            }
        }
开发者ID:jeswin,项目名称:AgileFx,代码行数:44,代码来源:BasicMapping.cs


示例9: VisitUpdate

 protected override Expression VisitUpdate(UpdateCommand update)
 {
     this.Append("UPDATE ");
     WriteTableName(update.Table.Mapping);
     //if (Dialect.SupportSchema && !string.IsNullOrEmpty(update.Table.Mapping.Schema))
     //{
     //    sb.Append(Dialect.Quote(update.Table.Mapping.Schema));
     //    sb.Append(".");
     //}
     //this.AppendTableName(update.Table.Name);
     this.AppendLine(Indentation.Same);
     bool saveHide = this.HideColumnAliases;
     this.HideColumnAliases = true;
     this.Append("SET ");
     for (int i = 0, n = update.Assignments.Count; i < n; i++)
     {
         ColumnAssignment ca = update.Assignments[i];
         if (i > 0) this.Append(", ");
         this.Visit(ca.Column);
         this.Append(" = ");
         this.Visit(ca.Expression);
     }
     if (update.Where != null)
     {
         this.AppendLine(Indentation.Same);
         this.Append("WHERE ");
         this.VisitPredicate(update.Where);
     }
     this.HideColumnAliases = saveHide;
     return update;
 }
开发者ID:netcasewqs,项目名称:elinq,代码行数:31,代码来源:DbSqlBuilder.cs


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


示例11: UpdateInativo

        public static OperationResult UpdateInativo(
            DataFieldCollection pValues,
            ConnectionInfo pInfo
        )
        {
            Transaction pTransaction;

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

            bool lLocalTransaction = (pTransaction != null);

            UpdateCommand lUpdate;

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

            if (lReturn.IsValid)
            {
                try
                {
                    lUpdate = new UpdateCommand(AtuacaoQD.TableName);

                    foreach (DataField lField in pValues.Keys)
                    {
                        if ((lField.Name != AtuacaoQD._PESF_ID.Name))
                            lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
                    }

                    string lSql = "";
                    lSql = String.Format("WHERE {0} = <<{0}", AtuacaoQD._PESF_ID.Name);
                    lUpdate.Condition = lSql;
                    lUpdate.Conditions.Add(AtuacaoQD._PESF_ID.Name, pValues[AtuacaoQD._PESF_ID].DBToDecimal());

                    lUpdate.Execute(pTransaction);

                    if (!lReturn.HasError)
                    {
                        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_PORTAL,代码行数:65,代码来源:AtuacaoDo.cs


示例12: VisitUpdate

 protected virtual Expression VisitUpdate(UpdateCommand update)
 {
     var table = (TableExpression)this.Visit(update.Table);
     var where = this.Visit(update.Where);
     var assignments = this.VisitColumnAssignments(update.Assignments);
     return this.UpdateUpdate(update, table, where, assignments);
 }
开发者ID:bisand,项目名称:NetCouch,代码行数:7,代码来源:DbExpressionVisitor.cs


示例13: UpdateUpdate

 protected UpdateCommand UpdateUpdate(UpdateCommand update, TableExpression table, Expression where, IEnumerable<ColumnAssignment> assignments)
 {
     if (table != update.Table || where != update.Where || assignments != update.Assignments)
     {
         return new UpdateCommand(table, where, assignments);
     }
     return update;
 }
开发者ID:bisand,项目名称:NetCouch,代码行数:8,代码来源:DbExpressionVisitor.cs


示例14: GetUpdateExpression

        public virtual Expression GetUpdateExpression(IEntityMapping mapping, Expression instance, LambdaExpression updateCheck, LambdaExpression selector, Expression @else)
        {
            var tableAlias = new TableAlias();
            var table = new TableExpression(tableAlias, mapping);

            var where = this.GetIdentityCheck(table, mapping, instance);
            if (updateCheck != null)
            {
                Expression typeProjector = this.GetEntityExpression(table, mapping);
                Expression pred = DbExpressionReplacer.Replace(updateCheck.Body, updateCheck.Parameters[0], typeProjector);
                where = where != null ? where.And(pred) : pred;
            }

            var assignments = this.GetColumnAssignments(table, instance, mapping, m => m.IsUpdatable && !m.IsVersion);

            var version = mapping.Version;
            bool supportsVersionCheck = false;

            if (version != null)
            {
                var versionValue = GetVersionValue(mapping, instance);
                var versionExp = Expression.Constant(versionValue, version.MemberType);
                var memberExpression = GetMemberExpression(table, mapping, mapping.Version);
                var versionCheck = memberExpression.Equal(versionExp);
                where = (where != null) ? where.And(versionCheck) : versionCheck;

                if (version.MemberType.IsNullable())
                {
                    var versionAssignment = new ColumnAssignment(
                           memberExpression as ColumnExpression,
                           versionValue == null ?
                                                (Expression)Expression.Constant(1, version.MemberType)
                                                : Expression.Add(memberExpression, Expression.Constant(1, version.MemberType))
                           );
                    assignments.Add(versionAssignment);
                    supportsVersionCheck = true;
                }
                else
                {
                    var versionAssignment = new ColumnAssignment(
                         memberExpression as ColumnExpression,
                          Expression.Add(memberExpression, Expression.Constant(1, version.MemberType))
                         );
                    assignments.Add(versionAssignment);
                    supportsVersionCheck = true;
                }
            }

            object o = null;
            var c = instance as ConstantExpression;
            if (c != null)
                o = c.Value;
            Expression update = new UpdateCommand(table, where, o, supportsVersionCheck, assignments);

            if (selector != null)
            {
                return new BlockCommand(
                    update,
                    new IFCommand(
                        this.GetRowsAffectedExpression(update).GreaterThan(Expression.Constant(0)),
                        this.GetUpdateResult(mapping, instance, selector),
                        @else
                        )
                    );
            }
            else if (@else != null)
            {
                return new BlockCommand(
                    update,
                    new IFCommand(
                        this.GetRowsAffectedExpression(update).LessThanOrEqual(Expression.Constant(0)),
                        @else,
                        null
                        )
                    );
            }
            else
            {
                return update;
            }
        }
开发者ID:jaykizhou,项目名称:elinq,代码行数:81,代码来源:DbExpressionBuilder.cs


示例15: DetermineStateEntriesFromSource

 private IEnumerable<IEntityStateEntry> DetermineStateEntriesFromSource(UpdateCommand source)
 {
     if (null == source)
     {
         return Enumerable.Empty<IEntityStateEntry>();
     }
     return source.GetStateEntries(this);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:UpdateTranslator.cs


示例16: ZipUpdate

 public ZipUpdate(IStaticDataSource dataSource, ZipEntry entry)
 {
     command_ = UpdateCommand.Add;
     entry_ = entry;
     dataSource_ = dataSource;
 }
开发者ID:eopeter,项目名称:dmelibrary,代码行数:6,代码来源:ZipFile.cs


示例17: ExcluirTodos

        public static OperationResult ExcluirTodos(
           DataFieldCollection pValues,
           Transaction pTransactionAtivo,
           ConnectionInfo pInfo
        )
        {
            Transaction pTransaction;

            bool lLocalTransaction = (pTransactionAtivo == null);

            if (lLocalTransaction)
                pTransaction = new Transaction(Instance.CreateDatabase(pInfo));
            else
                pTransaction = pTransactionAtivo;

            UpdateCommand lUpdate;

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

            ValidateUpdate(pValues, lReturn);

            if (lReturn.IsValid)
            {
                try
                {

                    lUpdate = new UpdateCommand(SituacaoFamiliarResideQD.TableName);

                    foreach (DataField lField in pValues.Keys)
                    {
                        if ((lField.Name != SituacaoFamiliarResideQD._STFAM_ID.Name))
                            lUpdate.Fields.Add(lField.Name, pValues[lField], (ItemType)lField.DBType);
                    }

                    string lSql = "";
                    lSql = String.Format("WHERE {0} = <<{0}", SituacaoFamiliarResideQD._STFAM_ID.Name);
                    lUpdate.Condition = lSql;
                    lUpdate.Conditions.Add(SituacaoFamiliarResideQD._STFAM_ID.Name, pValues[SituacaoFamiliarResideQD._STFAM_ID].DBToDecimal());

                    lUpdate.Execute(pTransaction);

                    if (!lReturn.HasError)
                    {
                        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,代码行数:72,代码来源:SituacaoFamiliarResideDo.cs


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


示例19: SendUpdateCommandBtn_Click

        //Update Command
        private void SendUpdateCommandBtn_Click(object sender, RoutedEventArgs e)
        {
            string appDir = System.IO.Path.Combine(Assembly.GetEntryAssembly().Location.Substring(0, Assembly.GetEntryAssembly().Location.LastIndexOf(System.IO.Path.DirectorySeparatorChar)));
            string rootpath = GetDestDirName(appDir);
            string xmlPath = string.Empty;
            ComboBoxItem item = (ComboBoxItem)this.UpdateNameComboBox.SelectedItem;
            string updateName = item.Content.ToString();

            UpdateCommand updateCommand = new UpdateCommand();
            XmlDocument doc = new XmlDocument();
            switch (updateName)
            {
                case "PrivateDailyQuotation":
                    xmlPath = System.IO.Path.Combine(rootpath, "Commands\\AccountUpdate.xml");
                    break;
                case "SystemParameter":
                    break;
                case "Instruments":
                    break;
                case "Instrument":
                    break;
                case "Account":
                    xmlPath = System.IO.Path.Combine(rootpath, "Commands\\AccountUpdate.xml");
                    break;
                case "Customers":
                    break;
                case "Customer":
                    break;
                case "QuotePolicy":
                    break;
                case "QuotePolicyDetails":
                    break;
                case "QuotePolicyDetail":
                    break;
                case "TradePolicy":
                    break;
                case "TradePolicyDetail":
                    break;
                case "TradePolicyDetails":
                    break;
                case "DealingConsoleInstrument":
                    break;
            }
            doc.Load(xmlPath);
            updateCommand.Content = doc.DocumentElement;
            ManagerClient.AddCommand(updateCommand);
        }
开发者ID:BlueSky007,项目名称:ExchangeManager,代码行数:48,代码来源:StateServerControl.xaml.cs


示例20: CompareToType

        internal override int CompareToType(UpdateCommand otherCommand)
        {
            Debug.Assert(!ReferenceEquals(this, otherCommand), "caller should ensure other command is different");

            var other = (FunctionUpdateCommand)otherCommand;

            // first state entry is the 'main' state entry for the command (see ctor)
            var thisParent = _stateEntries[0];
            var otherParent = other._stateEntries[0];

            // order by operator
            var result = (int)GetModificationOperator(thisParent.State) -
                         (int)GetModificationOperator(otherParent.State);
            if (0 != result)
            {
                return result;
            }

            // order by entity set
            result = StringComparer.Ordinal.Compare(thisParent.EntitySet.Name, otherParent.EntitySet.Name);
            if (0 != result)
            {
                return result;
            }
            result = StringComparer.Ordinal.Compare(thisParent.EntitySet.EntityContainer.Name, otherParent.EntitySet.EntityContainer.Name);
            if (0 != result)
            {
                return result;
            }

            // order by key values
            var thisInputIdentifierCount = (null == _inputIdentifiers ? 0 : _inputIdentifiers.Count);
            var otherInputIdentifierCount = (null == other._inputIdentifiers ? 0 : other._inputIdentifiers.Count);
            result = thisInputIdentifierCount - otherInputIdentifierCount;
            if (0 != result)
            {
                return result;
            }
            for (var i = 0; i < thisInputIdentifierCount; i++)
            {
                var thisParameter = _inputIdentifiers[i].Value;
                var otherParameter = other._inputIdentifiers[i].Value;
                result = ByValueComparer.Default.Compare(thisParameter.Value, otherParameter.Value);
                if (0 != result)
                {
                    return result;
                }
            }

            // If the result is still zero, it means key values are all the same. Switch to synthetic identifiers
            // to differentiate.
            for (var i = 0; i < thisInputIdentifierCount; i++)
            {
                var thisIdentifier = _inputIdentifiers[i].Key;
                var otherIdentifier = other._inputIdentifiers[i].Key;
                result = thisIdentifier - otherIdentifier;
                if (0 != result)
                {
                    return result;
                }
            }

            return result;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:64,代码来源:FunctionUpdateCommand.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UpdateFlags类代码示例发布时间:2022-05-24
下一篇:
C# Update类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap