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


C# Boolean.IsFalse方法代码示例

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


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

示例1: OpenDataSetThroughAdapter

        public void OpenDataSetThroughAdapter(String strSquery, ref System.Data.DataSet dsSetRef, CommandType cmdType,
            Boolean blnRequiredTransaction, Boolean blnJoinedQuery, String strActualQuery, String strConName)
        {
            System.Data.IDbDataAdapter IDBAdpater;
            System.Data.IDbCommand IMainCommand;
            dsSetRef = new DataSet();
            Boolean blnBeginTrans = false;
            try
            {
                if ((strSquery.Trim()).Length == 0)
                    throw new Exception("Query is blank");

                if (ProviderType == Util.ConnectionLibrary.SQlClient)
                {
                    IMainCommand = new SqlCommand();
                }
                else if (ProviderType == Util.ConnectionLibrary.Oledb)
                {
                    IMainCommand = new OleDbCommand();
                }
                else if (ProviderType == Util.ConnectionLibrary.ODBC)
                {
                    IMainCommand = new OdbcCommand();
                }
                else
                {
                    IMainCommand = null;
                }

                IMainCommand.CommandTimeout = CommandTimeOutValue;

                if (blnRequiredTransaction == false)
                {
                    if (strConName.Length > 0)
                    {
                        OpenConnection(strConName);
                    }
                    else
                    {
                        OpenConnection(String.Empty);
                    }

                    transaction = disconnection.BeginTransaction(IsolationLevel.ReadUncommitted);
                    blnBeginTrans = true;
                }
                else
                {
                    if (mblnTransactionStart)
                    {
                        blnBeginTrans = true;
                    }
                }

                if (disconnection.IsNotNull() && disconnection.State == ConnectionState.Open)
                {
                    IMainCommand.CommandText = strSquery;
                    IMainCommand.CommandType = cmdType;
                    IMainCommand.Connection = disconnection;
                    if (blnBeginTrans)
                    {
                        IMainCommand.Transaction = transaction;
                    }

                    if (ProviderType == Util.ConnectionLibrary.SQlClient)
                    {
                        IDBAdpater = new SqlDataAdapter((SqlCommand)IMainCommand);
                    }

                    else if (ProviderType == Util.ConnectionLibrary.Oledb)
                    {
                        IDBAdpater = new OleDbDataAdapter((OleDbCommand)IMainCommand);
                    }
                    else if (ProviderType == Util.ConnectionLibrary.ODBC)
                    {
                        IDBAdpater = new OdbcDataAdapter((OdbcCommand)IMainCommand);
                    }
                    else
                    {
                        IDBAdpater = null;
                    }
                    //IDBAdpater.FillSchema(dsSetRef,SchemaType.Mapped);
                    IDBAdpater.Fill(dsSetRef);

                    foreach (DataTable dt in dsSetRef.Tables)
                    {
                        dt.ExtendedProperties.Add(Query, strSquery);
                        dt.ExtendedProperties.Add(UpdateQuery, strActualQuery);
                        dt.ExtendedProperties.Add(JoinedQuery, blnJoinedQuery);

                    }
                }
                if (blnRequiredTransaction.IsFalse())
                {
                    if (blnBeginTrans)
                    {
                        transaction.Commit();
                        blnBeginTrans = false;
                    }
                }
                return;
//.........这里部分代码省略.........
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:101,代码来源:ConnectionManager.cs

示例2: OpenDataReader

        public void OpenDataReader(String query, out IDataReader readerRef,
            CommandBehavior behaviour, Boolean requiredTransaction, String procedureName,
            IDbDataParameter[] oleDbParameterArray, String conName)
        {
            IDbCommand mainCommand;
            try
            {
                if ((procedureName.Trim()).Length.IsZero())
                {
                    if ((query.Trim()).Length.IsZero())
                        throw new Exception("Query is blank");
                }

                switch (ProviderType)
                {
                    case Util.ConnectionLibrary.SQlClient:
                        mainCommand = new SqlCommand();
                        break;
                    case Util.ConnectionLibrary.Oledb:
                        mainCommand = new OleDbCommand();
                        break;
                    case Util.ConnectionLibrary.ODBC:
                        mainCommand = new OdbcCommand();
                        break;
                    default:
                        mainCommand = null;
                        break;
                }

                if (mainCommand.IsNull())
                {
                    readerRef = null;
                    return;
                }
                if (requiredTransaction.IsFalse())
                {
                    if (conName.Length > 0)
                    {
                        OpenConnection(conName);
                    }
                    else
                    {
                        OpenConnection(String.Empty);
                    }
                }
                else
                {
                    mainCommand.Transaction = transaction;
                }

                if ((procedureName.Trim()).Length.IsZero())
                {
                    mainCommand.CommandType = CommandType.Text;
                    mainCommand.CommandText = query;

                }
                else if (oleDbParameterArray.IsNull() && (procedureName.Trim()).Length > 0)
                {
                    mainCommand.CommandType = CommandType.StoredProcedure;
                    mainCommand.CommandText = procedureName;

                }
                else if (oleDbParameterArray.IsNotNull() && (procedureName.Trim()).Length > 0)
                {
                    mainCommand.CommandType = CommandType.StoredProcedure;
                    mainCommand.CommandText = procedureName;
                    for (Int32 i = 0; i < oleDbParameterArray.Length; i++)
                    {
                        if (oleDbParameterArray[i].IsNotNull())
                        {
                            mainCommand.Parameters.Add(oleDbParameterArray[i]);
                        }
                    }
                }
                else
                {
                    throw new Exception("Could Not Create the Command Object");
                }

                mainCommand.CommandTimeout = CommandTimeOutValue;

                mainCommand.Connection = disconnection;

                readerRef = mainCommand.ExecuteReader(behaviour);
            }
            catch (Exception ex)
            {
                CloseConnection();
                throw (ex);
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:91,代码来源:ConnectionManager.cs

示例3: ConnectionManager

        public ConnectionManager(String strConn, Boolean isConnectionString, Util.ConnectionLibrary eType)
        {
            String connectionString = String.Empty;

            if (isConnectionString.IsFalse())
            {
                ProvideConnectionInfo(strConn, ref connectionString, ref eType);
            }
            else
            {
                connectionString = strConn;
                mblnIsConnectionString = true;
            }
            if (connectionString.Trim().Length > 0)
            {
                Initailize(connectionString, eType);
            }
            else
            {
                throw new Exception("DAL is not configured properly\n.There is no link between Application Server and Database Server. Please configure the Application Server properly or ask your MIS Officer or technical person to do so.");
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:22,代码来源:ConnectionManager.cs

示例4: ExecuteScalarWrapper

        public Object ExecuteScalarWrapper(Boolean requiredTransaction, String conName, String spName, params Object[] parameterValues)
        {
            Boolean blnBeginTrans = false;
            try
            {
                if ((spName.Trim()).Length.IsZero())
                    throw new Exception("spName is blank");

                Object objRtValue = null;

                if (requiredTransaction.IsFalse())
                {
                    if (conName.Length > 0)
                    {
                        OpenConnection(conName);
                    }
                    else
                    {
                        OpenConnection(String.Empty);
                    }
                    transaction = disconnection.BeginTransaction(IsolationLevel.ReadUncommitted);
                    blnBeginTrans = true;
                }
                else
                {
                    blnBeginTrans = true;
                }

                objRtValue = DataAccessHelper.ExecuteScalar(transaction, spName, parameterValues);

                if (requiredTransaction.IsFalse())
                {
                    if (blnBeginTrans)
                    {
                        transaction.Commit();
                        blnBeginTrans = false;
                    }
                }

                return objRtValue;
            }
            catch (Exception ex)
            {
                if (requiredTransaction.IsFalse())
                {
                    if (blnBeginTrans)
                    {
                        transaction.Rollback();
                    }
                }
                throw (ex);
            }
            finally
            {
                if (requiredTransaction.IsFalse())
                {
                    CloseConnection();
                }
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:60,代码来源:ConnectionManager.cs

示例5: SaveDataSetThroughAdapter

        public void SaveDataSetThroughAdapter(System.Data.DataSet dsSetRef,
            Boolean blnRequiredTransaction, String ExcludeTableName, String strConName)
        {
            Boolean blnBeginTrans = false;
            OleDbDataAdapter objOleDBAdpater;
            OdbcDataAdapter objOdbcDBAdpater;
            SqlDataAdapter objSqlDBAdpater;

            OdbcCommandBuilder objOdbcDBCommandBuilder;
            OleDbCommandBuilder objOleDBCommandBuilder;
            SqlCommandBuilder objSqlDBCommandBuilder;

            IDbCommand IMainCommand;

            DataTable dtInsert;
            DataTable dtUpdate;
            DataTable dtDelete;
            Boolean TableExist;
            String strQuery;

            try
            {

                if (dsSetRef == null)
                {
                    throw new Exception("DataSet not Initialized");
                }

                String[] TableName;

                char[] delimeter;
                String seperator;
                seperator = ",";
                delimeter = seperator.ToCharArray();
                TableName = ExcludeTableName.Split(delimeter);

                if (blnRequiredTransaction.IsFalse())
                {
                    if (strConName.Length > 0)
                    {
                        OpenConnection(strConName);
                    }
                    else
                    {
                        OpenConnection(String.Empty);
                    }
                }

                if (disconnection.IsNotNull())
                {
                    if (blnRequiredTransaction.IsFalse())
                    {
                        transaction = disconnection.BeginTransaction(IsolationLevel.ReadUncommitted);
                        blnBeginTrans = true;
                    }
                    else
                    {
                        if (transaction == null)
                        {
                            throw new Exception("Transaction is not initialized");
                        }
                        else
                        {
                            blnBeginTrans = true;
                        }
                    }

                    if (ProviderType == Util.ConnectionLibrary.SQlClient)
                    {
                        IMainCommand = new SqlCommand();
                    }
                    else if (ProviderType == Util.ConnectionLibrary.Oledb)
                    {
                        IMainCommand = new OleDbCommand();
                    }
                    else if (ProviderType == Util.ConnectionLibrary.ODBC)
                    {
                        IMainCommand = new OdbcCommand();
                    }
                    else
                    {
                        IMainCommand = null;
                    }

                    IMainCommand.Connection = disconnection;
                    IMainCommand.Transaction = transaction;
                }
                else
                {
                    throw new Exception("Connection is not initialized");
                }

                IMainCommand.CommandTimeout = CommandTimeOutValue;

                foreach (DataTable dtRef in dsSetRef.Tables)
                {
                    TableExist = false;
                    foreach (String tablename in TableName)
                    {
                        if (dtRef.TableName.ToUpper() == tablename.ToUpper())
//.........这里部分代码省略.........
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:101,代码来源:ConnectionManager.cs

示例6: SaveDataCollectionThroughCollection

        public void SaveDataCollectionThroughCollection(Boolean requiredTransaction, String conName, params IEnumerable[] saveItems)
        {
            CommandExecutor command;
            Boolean blnBeginTrans = false;

            CustomList<BaseItem> itemNew;
            CustomList<BaseItem> itemUpdate;
            CustomList<BaseItem> itemDelete;

            try
            {

                if (saveItems.IsNull() || saveItems.Count().IsZero())
                {
                    throw new Exception("Collection not Initialized");
                }

                if (requiredTransaction.IsFalse())
                {
                    if (conName.Length > 0)
                    {
                        OpenConnection(conName);
                    }
                    else
                    {
                        OpenConnection(String.Empty);
                    }
                }

                if (disconnection.IsNotNull())
                {
                    if (requiredTransaction.IsFalse())
                    {
                        transaction = disconnection.BeginTransaction(IsolationLevel.ReadUncommitted);
                        blnBeginTrans = true;
                    }
                    else
                    {
                        if (transaction.IsNull())
                        {
                            throw new Exception("Transaction is not initialized");
                        }
                        blnBeginTrans = true;
                    }
                }
                else
                {
                    throw new Exception("Connection is not initialized");
                }

                //For Delete
                saveItems = saveItems.Reverse();
                foreach (IEnumerable saveList in saveItems)
                {
                    CustomList<BaseItem> saveItemBase = saveList.ToCustomList<BaseItem>();
                    itemDelete = saveItemBase.GetChanges(ItemState.Deleted);

                    switch (ProviderType)
                    {
                        case Util.ConnectionLibrary.SQlClient:
                            command = new CommandExecutor(transaction, ProviderType);
                            if (itemDelete.IsNotNull() && itemDelete.Count.NotEquals(0))
                            {
                                command.Update(itemDelete, Util.OperationType.Delete);
                            }
                            break;
                    }
                }
                //For Insert Update
                saveItems = saveItems.Reverse();
                foreach (IEnumerable saveList in saveItems)
                {
                    CustomList<BaseItem> saveItemBase = saveList.ToCustomList<BaseItem>();

                    itemNew = saveItemBase.GetChanges(ItemState.Added);
                    itemUpdate = saveItemBase.GetChanges(ItemState.Modified);

                    switch (ProviderType)
                    {
                        case Util.ConnectionLibrary.SQlClient:
                            command = new CommandExecutor(transaction, ProviderType);
                            if (itemNew.IsNotNull() && itemNew.Count.NotEquals(0))
                            {
                                command.Update(itemNew, Util.OperationType.Insert);
                            }
                            if (itemUpdate.IsNotNull() && itemUpdate.Count.NotEquals(0))
                            {
                                command.Update(itemUpdate, Util.OperationType.Update);
                            }
                            break;
                    }
                }

                if (requiredTransaction.IsFalse())
                {
                    if (blnBeginTrans)
                    {
                        transaction.Commit();
                        blnBeginTrans = false;
                    }
//.........这里部分代码省略.........
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:101,代码来源:ConnectionManager.cs


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