本文整理汇总了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;
//.........这里部分代码省略.........
示例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);
}
}
示例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.");
}
}
示例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();
}
}
}
示例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())
//.........这里部分代码省略.........
示例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;
}
//.........这里部分代码省略.........