本文整理汇总了C#中Microsoft.GetStoredProcCommand方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.GetStoredProcCommand方法的具体用法?C# Microsoft.GetStoredProcCommand怎么用?C# Microsoft.GetStoredProcCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.GetStoredProcCommand方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSelectCommand
public override DbCommand GetSelectCommand(Microsoft.Practices.EnterpriseLibrary.Data.Database db, string keyValue)
{
string proc = "WCS.GetEquipmentDetail";
DbCommand cmd = db.GetStoredProcCommand(proc);
db.AddInParameter(cmd, "pKeyValue", DbType.Int32, Fn.ToInt(keyValue));
return cmd;
}
示例2: GetSelectCommand
//protected override void InitNewRow()
//{
// this["assignto_function"] = "wfl.f_GetAssignTo_StateOwner";
// base.InitNewRow();
//}
public override DbCommand GetSelectCommand(Microsoft.Practices.EnterpriseLibrary.Data.Database db, string keyValue)
{
if (keyValue == "") keyValue = "0";
string proc = "security.GetWflStateHeadDetail";
DbCommand cmd = db.GetStoredProcCommand(proc);
db.AddInParameter(cmd, "pDjId", DbType.String, keyValue);
return cmd;
}
示例3: Insert
public override bool Insert(string newKeyValue, System.Collections.Hashtable dataControlCollection, Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbTransaction transaction)
{
if (base.Insert(newKeyValue, dataControlCollection, db, transaction))
{
DbCommand cmd = db.GetStoredProcCommand("wcs.AddCellDirection");
db.AddInParameter(cmd, "pWhId", DbType.Int32, KeyValue);
db.ExecuteNonQuery(cmd, transaction);
return true;
}
return true;
}
示例4: ExecuteWriteLogStoredProcedure
/// <summary>
/// Executes the WriteLog stored procedure
/// </summary>
/// <param name="msgEntry">The MsgEntry to store in the database.</param>
/// <param name="db">An instance of the database class to use for storing the MsgEntry</param>
/// <param name="transaction">The transaction that wraps around the execution calls for storing the MsgEntry</param>
/// <returns>An integer for the MsgEntry Id</returns>
private int ExecuteWriteLogStoredProcedure(MsgEntry msgEntry, Microsoft.Practices.EnterpriseLibrary.Data.Database db, DbTransaction transaction)
{
DbCommand cmd = db.GetStoredProcCommand(writeLogStoredProcName);
//db.AddInParameter(cmd, "eventID", DbType.Int32, msgEntry.EventId);
//db.AddInParameter(cmd, "priority", DbType.Int32, msgEntry.Priority);
//db.AddParameter(cmd, "severity", DbType.String, 32, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.Severity.ToString());
//db.AddParameter(cmd, "title", DbType.String, 256, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.Title);
//db.AddInParameter(cmd, "timestamp", DbType.DateTime, msgEntry.TimeStamp);
//db.AddParameter(cmd, "machineName", DbType.String, 32, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.MachineName);
//db.AddParameter(cmd, "AppDomainName", DbType.String, 512, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.AppDomainName);
//db.AddParameter(cmd, "ProcessID", DbType.String, 256, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.ProcessId);
//db.AddParameter(cmd, "ProcessName", DbType.String, 512, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.ProcessName);
//db.AddParameter(cmd, "ThreadName", DbType.String, 512, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.ManagedThreadName);
//db.AddParameter(cmd, "Win32ThreadId", DbType.String, 128, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.Win32ThreadId);
//db.AddParameter(cmd, "message", DbType.String, 1500, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, msgEntry.Message);
//if (Formatter != null)
// db.AddInParameter(cmd, "formattedmessage", DbType.String, Formatter.Format(msgEntry));
//else
// db.AddInParameter(cmd, "formattedmessage", DbType.String, msgEntry.Message);
//db.AddOutParameter(cmd, "LogId", DbType.Int32, 4);
db.ExecuteNonQuery(cmd, transaction);
int logId = Convert.ToInt32(cmd.Parameters[cmd.Parameters.Count - 1].Value, CultureInfo.InvariantCulture);
return logId;
}
示例5: ExecuteAddCategoryStoredProcedure
/// <summary>
/// Executes the AddCategory stored procedure
/// </summary>
/// <param name="msgEntry">The MsgEntry to store in the database.</param>
/// <param name="logID">The unique identifer for the MsgEntry as obtained from the WriteLog Stored procedure.</param>
/// <param name="db">An instance of the database class to use for storing the MsgEntry</param>
/// <param name="transaction">The transaction that wraps around the execution calls for storing the MsgEntry</param>
private void ExecuteAddCategoryStoredProcedure(MsgEntry msgEntry, int logID, Microsoft.Practices.EnterpriseLibrary.Data.Database db, DbTransaction transaction)
{
foreach (string category in msgEntry.Categories)
{
DbCommand cmd = db.GetStoredProcCommand(addCategoryStoredProcName);
db.AddInParameter(cmd, "categoryName", DbType.String, category);
db.AddInParameter(cmd, "logID", DbType.Int32, logID);
db.ExecuteNonQuery(cmd, transaction);
}
}
示例6: DeleteLoginUser
private Arthur.PurchaseEntryDL.TransactionResult DeleteLoginUser(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbTransaction transaction)
{
Arthur.PurchaseEntryDL.TransactionResult transactionResult;
int i = 0;
System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand("spDeleteLoginUser");
db.AddInParameter(dbCommand, "LoginID", System.Data.DbType.Int32, this._loginId);
db.AddParameter(dbCommand, "Return Value", System.Data.DbType.Int32, System.Data.ParameterDirection.ReturnValue, "Return Value", System.Data.DataRowVersion.Default, i);
db.ExecuteNonQuery(dbCommand, transaction);
i = (int)db.GetParameterValue(dbCommand, "Return Value");
transactionResult = i == -1 ? new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Failure, "Failure Deleted") : new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Success, "Successfully Deleted");
return transactionResult;
}
示例7: AddEditLoginUser
private Arthur.PurchaseEntryDL.TransactionResult AddEditLoginUser(Microsoft.Practices.EnterpriseLibrary.Data.Database db, System.Data.Common.DbTransaction transaction)
{
int i;
Arthur.PurchaseEntryDL.TransactionResult transactionResult;
bool bl;
i = 0;
System.Data.Common.DbCommand dbCommand = db.GetStoredProcCommand("spAddEditLoginUser");
db.AddInParameter(dbCommand, "LoginID", System.Data.DbType.Int32, this._loginId);
db.AddInParameter(dbCommand, "CompanyID", System.Data.DbType.Int32, this._companyId);
db.AddInParameter(dbCommand, "UserName", System.Data.DbType.String, this._userName);
db.AddInParameter(dbCommand, "Password", System.Data.DbType.String, this._password);
db.AddInParameter(dbCommand, "RoleID", System.Data.DbType.String, this._roleId);
db.AddInParameter(dbCommand, "LoginAccess", System.Data.DbType.Boolean, this._loginAccess);
db.AddInParameter(dbCommand, "AddEditOption", System.Data.DbType.Int16, this._addEditOption);
db.AddParameter(dbCommand, "Return Value", System.Data.DbType.Int32, System.Data.ParameterDirection.ReturnValue, "Return Value", System.Data.DataRowVersion.Default, i);
db.ExecuteNonQuery(dbCommand, transaction);
this._loginId = (int)db.GetParameterValue(dbCommand, "Return Value");
bl = i != 0;
if (!bl)
{
transactionResult = new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Failure, "User Name Already Exists. Please Change Some Other Name");
}
else
{
bl = i != -1;
if (!bl)
{
bl = this._addEditOption != 1;
if (!bl)
{
return new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Failure, "Failure Updated");
}
transactionResult = new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Failure, "Failure Adding");
}
else
{
bl = this._addEditOption != 1;
transactionResult = !bl ? new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Success, "Successfully Updated") : new Arthur.PurchaseEntryDL.TransactionResult(Arthur.PurchaseEntryDL.TransactionStatus.Success, "Successfully Added");
}
}
return transactionResult;
}