本文整理匯總了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;
}
//.........這裏部分代碼省略.........