本文整理汇总了C#中POS.DataLayer.DatabaseHelper.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHelper.ExecuteScalar方法的具体用法?C# DatabaseHelper.ExecuteScalar怎么用?C# DatabaseHelper.ExecuteScalar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POS.DataLayer.DatabaseHelper
的用法示例。
在下文中一共展示了DatabaseHelper.ExecuteScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseOrder
public static bool CloseOrder(int SalesHeaderID, int UserID)
{
DatabaseHelper oDatabaseHelper = new DatabaseHelper();
bool ExecutionState = false;
// Pass the value of '_deletedBy' as parameter 'DeletedBy' of the stored procedure.
oDatabaseHelper.AddParameter("@UserID", UserID);
oDatabaseHelper.AddParameter("@SlaesReturnHeaderID", SalesHeaderID);
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("usp_SALSalesReturnHader_CloseOrder", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例2: CloseOrder
public bool CloseOrder(int INVTransferHeaderID, int UserID, INVTransferLineCollection transferLineCollection)
{
oDatabaseHelper = new DatabaseHelper();
bool ExecutionState = false;
oDatabaseHelper.BeginTransaction();
oDatabaseHelper.AddParameter("@UserID", UserID);
oDatabaseHelper.AddParameter("@INVTransferHeaderID", INVTransferHeaderID);
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("usp_INVTransferHader_CloseOrder", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState);
if (ExecutionState)
oDatabaseHelper.CommitTransaction();
else
oDatabaseHelper.RollbackTransaction();
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例3: InsertWithDefaultValues
/// <summary>
/// This method will insert one new row into the database using the property Information
/// </summary>
/// <param name="getBackValues" type="bool">Whether to get the default values inserted, from the database</param>
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:09 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool InsertWithDefaultValues(bool getBackValues)
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_adjustStockreasonName' as parameter 'AdjustStockreasonName' of the stored procedure.
if(_adjustStockreasonNameNonDefault!=null)
oDatabaseHelper.AddParameter("@AdjustStockreasonName", _adjustStockreasonNameNonDefault);
else
oDatabaseHelper.AddParameter("@AdjustStockreasonName", DBNull.Value );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
if(!getBackValues )
{
oDatabaseHelper.ExecuteScalar("gsp_INVAdjustStockReason_Insert_WithDefaultValues", ref ExecutionState);
}
else
{
IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_INVAdjustStockReason_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
if (dr.Read())
{
PopulateObjectFromReader(this,dr);
}
dr.Close();
}
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例4: InsertProductStockBatches
public bool InsertProductStockBatches(int userID, INVBatch iNVBatch)
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
oDatabaseHelper.AddParameter("@ProductStockID", iNVBatch.ProductStockID);
oDatabaseHelper.AddParameter("@BatchNumber", iNVBatch.BatchNumber);
oDatabaseHelper.AddParameter("@ExpiryDate", iNVBatch.ExpiryDate);
oDatabaseHelper.AddParameter("@Qty", iNVBatch.Qty);
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("usp_INVBatch_ProductStockBatch", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例5: Insert
/// <summary>
/// This method will insert one new row into the database using the property Information
/// </summary>
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:12 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Insert()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_stockTypeName' as parameter 'StockTypeName' of the stored procedure.
if(_stockTypeNameNonDefault!=null)
oDatabaseHelper.AddParameter("@StockTypeName", _stockTypeNameNonDefault);
else
oDatabaseHelper.AddParameter("@StockTypeName", DBNull.Value );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_INVStockType_Insert", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例6: SelectAllCount
/// <summary>
/// This method will return a count all records in the table.
/// </summary>
///
/// <returns>count records</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:27 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public static int SelectAllCount()
{
DatabaseHelper oDatabaseHelper = new DatabaseHelper();
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
Object dr=oDatabaseHelper.ExecuteScalar("gsp_ADUser_SelectAllCount");
int count = Convert.ToInt32(dr);
oDatabaseHelper.Dispose();
return count;
}
示例7: Update
/// <summary>
/// This method will Update one new row into the database using the property Information
/// </summary>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:07 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Update()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_productGroupID' as parameter 'ProductGroupID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductGroupID", _productGroupIDNonDefault );
// Pass the value of '_productGroupName' as parameter 'ProductGroupName' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductGroupName", _productGroupNameNonDefault );
// Pass the value of '_notes' as parameter 'Notes' of the stored procedure.
oDatabaseHelper.AddParameter("@Notes", _notesNonDefault );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_BDProductGroup_Update", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例8: Update
/// <summary>
/// This method will Update one new row into the database using the property Information
/// </summary>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:27 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Update()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_userID' as parameter 'UserID' of the stored procedure.
oDatabaseHelper.AddParameter("@UserID", _userIDNonDefault );
// Pass the value of '_userFullName' as parameter 'UserFullName' of the stored procedure.
oDatabaseHelper.AddParameter("@UserFullName", _userFullNameNonDefault );
// Pass the value of '_userName' as parameter 'UserName' of the stored procedure.
oDatabaseHelper.AddParameter("@UserName", _userNameNonDefault );
// Pass the value of '_password' as parameter 'Password' of the stored procedure.
oDatabaseHelper.AddParameter("@Password", _passwordNonDefault );
// Pass the value of '_groupID' as parameter 'GroupID' of the stored procedure.
oDatabaseHelper.AddParameter("@GroupID", _groupIDNonDefault );
// Pass the value of '_email' as parameter 'Email' of the stored procedure.
oDatabaseHelper.AddParameter("@Email", _emailNonDefault );
// Pass the value of '_address' as parameter 'Address' of the stored procedure.
oDatabaseHelper.AddParameter("@Address", _addressNonDefault );
// Pass the value of '_phone' as parameter 'Phone' of the stored procedure.
oDatabaseHelper.AddParameter("@Phone", _phoneNonDefault );
// Pass the value of '_mobile' as parameter 'Mobile' of the stored procedure.
oDatabaseHelper.AddParameter("@Mobile", _mobileNonDefault );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_ADUser_Update", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例9: Delete
/// <summary>
/// This method will Delete one row from the database using the primary key information
/// </summary>
///
/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:27 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public static bool Delete(ADUserPrimaryKey pk)
{
DatabaseHelper oDatabaseHelper = new DatabaseHelper();
bool ExecutionState = false;
// Pass the values of all key parameters to the stored procedure.
System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
foreach (string key in nvc.Keys)
{
oDatabaseHelper.AddParameter("@" + key,nvc[key] );
}
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_ADUser_Delete", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例10: Update
/// <summary>
/// This method will Update one new row into the database using the property Information
/// </summary>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:16 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Update()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_salesLineID' as parameter 'SalesLineID' of the stored procedure.
oDatabaseHelper.AddParameter("@SalesLineID", _salesLineIDNonDefault );
// Pass the value of '_salesHeaderID' as parameter 'SalesHeaderID' of the stored procedure.
oDatabaseHelper.AddParameter("@SalesHeaderID", _salesHeaderIDNonDefault );
// Pass the value of '_productID' as parameter 'ProductID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductID", _productIDNonDefault );
// Pass the value of '_totalQty' as parameter 'TotalQty' of the stored procedure.
oDatabaseHelper.AddParameter("@TotalQty", _totalQtyNonDefault );
// Pass the value of '_totalBonus' as parameter 'TotalBonus' of the stored procedure.
oDatabaseHelper.AddParameter("@TotalBonus", _totalBonusNonDefault );
// Pass the value of '_discountAmount' as parameter 'DiscountAmount' of the stored procedure.
oDatabaseHelper.AddParameter("@DiscountAmount", _discountAmountNonDefault );
// Pass the value of '_discountRatio' as parameter 'DiscountRatio' of the stored procedure.
oDatabaseHelper.AddParameter("@DiscountRatio", _discountRatioNonDefault );
// Pass the value of '_unitPrice' as parameter 'UnitPrice' of the stored procedure.
oDatabaseHelper.AddParameter("@UnitPrice", _unitPriceNonDefault );
// Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
oDatabaseHelper.AddParameter("@CreatedBy", _createdByNonDefault );
// Pass the value of '_createDate' as parameter 'CreateDate' of the stored procedure.
oDatabaseHelper.AddParameter("@CreateDate", _createDateNonDefault );
// Pass the value of '_updatedBy' as parameter 'UpdatedBy' of the stored procedure.
oDatabaseHelper.AddParameter("@UpdatedBy", _updatedByNonDefault );
// Pass the value of '_updateDate' as parameter 'UpdateDate' of the stored procedure.
oDatabaseHelper.AddParameter("@UpdateDate", _updateDateNonDefault );
// Pass the value of '_isDeleted' as parameter 'IsDeleted' of the stored procedure.
oDatabaseHelper.AddParameter("@IsDeleted", _isDeletedNonDefault );
// Pass the value of '_deletedBy' as parameter 'DeletedBy' of the stored procedure.
oDatabaseHelper.AddParameter("@DeletedBy", _deletedByNonDefault );
// Pass the value of '_deleteDate' as parameter 'DeleteDate' of the stored procedure.
oDatabaseHelper.AddParameter("@DeleteDate", _deleteDateNonDefault );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_SALSalesLine_Update", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例11: UpdateSupplierAccount
private bool UpdateSupplierAccount(DatabaseHelper oDatabaseHelper, BDSupplierAccount supplierAccount, bool ExecutionState)
{
oDatabaseHelper.AddParameter("@SupplierAccountId", supplierAccount.SupplierAccountId);
oDatabaseHelper.AddParameter("@PurcaseInvoiceID", supplierAccount.PurcaseInvoiceID);
oDatabaseHelper.AddParameter("@PurchaseDate", supplierAccount.PurchaseDate);
oDatabaseHelper.AddParameter("@SupplierID", supplierAccount.SupplierID);
oDatabaseHelper.AddParameter("@InvoiceNumber", supplierAccount.InvoiceNumber);
oDatabaseHelper.AddParameter("@TotalPrice", supplierAccount.TotalPrice);
oDatabaseHelper.AddParameter("@PaidAmount", supplierAccount.PaidAmount);
oDatabaseHelper.AddParameter("@IsVoid", supplierAccount.IsVoid);
oDatabaseHelper.AddParameter("@RemainingAmount", supplierAccount.RemainingAmount);
oDatabaseHelper.AddParameter("@CreateDate", supplierAccount.CreateDate);
oDatabaseHelper.AddParameter("@CreatedBy", supplierAccount.CreatedBy);
oDatabaseHelper.AddParameter("@updateDate", supplierAccount.updateDate);
oDatabaseHelper.AddParameter("@UpdatedBy", supplierAccount.UpdatedBy);
oDatabaseHelper.AddParameter("@IsDeleted", supplierAccount.IsDeleted);
oDatabaseHelper.AddParameter("@DeleteDate", supplierAccount.DeleteDate);
oDatabaseHelper.AddParameter("@DeletedBy", supplierAccount.DeletedBy);
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_BDSupplierAccounts_Update", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState);
return ExecutionState;
}
示例12: Update
/// <summary>
/// This method will Update one new row into the database using the property Information
/// </summary>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:14 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Update()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_productStockBatchID' as parameter 'ProductStockBatchID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductStockBatchID", _productStockBatchIDNonDefault );
// Pass the value of '_productStockID' as parameter 'ProductStockID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductStockID", _productStockIDNonDefault );
// Pass the value of '_batchID' as parameter 'BatchID' of the stored procedure.
oDatabaseHelper.AddParameter("@BatchID", _batchIDNonDefault );
// Pass the value of '_qty' as parameter 'Qty' of the stored procedure.
oDatabaseHelper.AddParameter("@Qty", _qtyNonDefault );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_INVProductStockBatch_Update", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例13: InsertWithDefaultValues
//.........这里部分代码省略.........
oDatabaseHelper.AddParameter("@SalesHeaderID", DBNull.Value );
// Pass the value of '_productID' as parameter 'ProductID' of the stored procedure.
if(_productIDNonDefault!=null)
oDatabaseHelper.AddParameter("@ProductID", _productIDNonDefault);
else
oDatabaseHelper.AddParameter("@ProductID", DBNull.Value );
// Pass the value of '_totalQty' as parameter 'TotalQty' of the stored procedure.
if(_totalQtyNonDefault!=null)
oDatabaseHelper.AddParameter("@TotalQty", _totalQtyNonDefault);
else
oDatabaseHelper.AddParameter("@TotalQty", DBNull.Value );
// Pass the value of '_totalBonus' as parameter 'TotalBonus' of the stored procedure.
if(_totalBonusNonDefault!=null)
oDatabaseHelper.AddParameter("@TotalBonus", _totalBonusNonDefault);
else
oDatabaseHelper.AddParameter("@TotalBonus", DBNull.Value );
// Pass the value of '_discountAmount' as parameter 'DiscountAmount' of the stored procedure.
if(_discountAmountNonDefault!=null)
oDatabaseHelper.AddParameter("@DiscountAmount", _discountAmountNonDefault);
else
oDatabaseHelper.AddParameter("@DiscountAmount", DBNull.Value );
// Pass the value of '_discountRatio' as parameter 'DiscountRatio' of the stored procedure.
if(_discountRatioNonDefault!=null)
oDatabaseHelper.AddParameter("@DiscountRatio", _discountRatioNonDefault);
else
oDatabaseHelper.AddParameter("@DiscountRatio", DBNull.Value );
// Pass the value of '_unitPrice' as parameter 'UnitPrice' of the stored procedure.
if(_unitPriceNonDefault!=null)
oDatabaseHelper.AddParameter("@UnitPrice", _unitPriceNonDefault);
else
oDatabaseHelper.AddParameter("@UnitPrice", DBNull.Value );
// Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
if(_createdByNonDefault!=null)
oDatabaseHelper.AddParameter("@CreatedBy", _createdByNonDefault);
else
oDatabaseHelper.AddParameter("@CreatedBy", DBNull.Value );
// Pass the value of '_createDate' as parameter 'CreateDate' of the stored procedure.
if(_createDateNonDefault!=null)
oDatabaseHelper.AddParameter("@CreateDate", _createDateNonDefault);
else
oDatabaseHelper.AddParameter("@CreateDate", DBNull.Value );
// Pass the value of '_updatedBy' as parameter 'UpdatedBy' of the stored procedure.
if(_updatedByNonDefault!=null)
oDatabaseHelper.AddParameter("@UpdatedBy", _updatedByNonDefault);
else
oDatabaseHelper.AddParameter("@UpdatedBy", DBNull.Value );
// Pass the value of '_updateDate' as parameter 'UpdateDate' of the stored procedure.
if(_updateDateNonDefault!=null)
oDatabaseHelper.AddParameter("@UpdateDate", _updateDateNonDefault);
else
oDatabaseHelper.AddParameter("@UpdateDate", DBNull.Value );
// Pass the value of '_isDeleted' as parameter 'IsDeleted' of the stored procedure.
if(_isDeletedNonDefault!=null)
oDatabaseHelper.AddParameter("@IsDeleted", _isDeletedNonDefault);
else
oDatabaseHelper.AddParameter("@IsDeleted", DBNull.Value );
// Pass the value of '_deletedBy' as parameter 'DeletedBy' of the stored procedure.
if(_deletedByNonDefault!=null)
oDatabaseHelper.AddParameter("@DeletedBy", _deletedByNonDefault);
else
oDatabaseHelper.AddParameter("@DeletedBy", DBNull.Value );
// Pass the value of '_deleteDate' as parameter 'DeleteDate' of the stored procedure.
if(_deleteDateNonDefault!=null)
oDatabaseHelper.AddParameter("@DeleteDate", _deleteDateNonDefault);
else
oDatabaseHelper.AddParameter("@DeleteDate", DBNull.Value );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
if(!getBackValues )
{
oDatabaseHelper.ExecuteScalar("gsp_SALSalesLine_Insert_WithDefaultValues", ref ExecutionState);
}
else
{
IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_SALSalesLine_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
if (dr.Read())
{
PopulateObjectFromReader(this,dr);
}
dr.Close();
}
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例14: Update
/// <summary>
/// This method will Update one new row into the database using the property Information
/// </summary>
///
/// <returns>True if succeeded</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:24 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public bool Update()
{
bool ExecutionState = false;
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_productID' as parameter 'ProductID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductID", _productIDNonDefault );
// Pass the value of '_productName' as parameter 'ProductName' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductName", _productNameNonDefault );
// Pass the value of '_productGroupID' as parameter 'ProductGroupID' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductGroupID", _productGroupIDNonDefault );
// Pass the value of '_productCode' as parameter 'ProductCode' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductCode", _productCodeNonDefault );
// Pass the value of '_isAcceptBatch' as parameter 'IsAcceptBatch' of the stored procedure.
oDatabaseHelper.AddParameter("@IsAcceptBatch", _isAcceptBatchNonDefault );
// Pass the value of '_productPrice' as parameter 'ProductPrice' of the stored procedure.
oDatabaseHelper.AddParameter("@ProductPrice", _productPriceNonDefault );
// Pass the value of '_isFixedPrice' as parameter 'IsFixedPrice' of the stored procedure.
oDatabaseHelper.AddParameter("@IsFixedPrice", _isFixedPriceNonDefault );
// Pass the value of '_hasDiscount' as parameter 'HasDiscount' of the stored procedure.
oDatabaseHelper.AddParameter("@HasDiscount", _hasDiscountNonDefault );
// Pass the value of '_discountAmount' as parameter 'DiscountAmount' of the stored procedure.
oDatabaseHelper.AddParameter("@DiscountAmount", _discountAmountNonDefault );
// Pass the value of '_descountRatio' as parameter 'DescountRatio' of the stored procedure.
oDatabaseHelper.AddParameter("@DescountRatio", _descountRatioNonDefault );
// Pass the value of '_isActive' as parameter 'IsActive' of the stored procedure.
oDatabaseHelper.AddParameter("@IsActive", _isActiveNonDefault );
// Pass the value of '_notes' as parameter 'Notes' of the stored procedure.
oDatabaseHelper.AddParameter("@Notes", _notesNonDefault );
// Pass the value of '_minPrice' as parameter 'MinPrice' of the stored procedure.
oDatabaseHelper.AddParameter("@MinPrice", _minPriceNonDefault );
// Pass the value of '_maxPrice' as parameter 'MaxPrice' of the stored procedure.
oDatabaseHelper.AddParameter("@MaxPrice", _maxPriceNonDefault );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteScalar("gsp_BDProduct_Update", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}
示例15: InsertWithDefaultValues
//.........这里部分代码省略.........
oDatabaseHelper = new DatabaseHelper();
// Pass the value of '_productName' as parameter 'ProductName' of the stored procedure.
if(_productNameNonDefault!=null)
oDatabaseHelper.AddParameter("@ProductName", _productNameNonDefault);
else
oDatabaseHelper.AddParameter("@ProductName", DBNull.Value );
// Pass the value of '_productGroupID' as parameter 'ProductGroupID' of the stored procedure.
if(_productGroupIDNonDefault!=null)
oDatabaseHelper.AddParameter("@ProductGroupID", _productGroupIDNonDefault);
else
oDatabaseHelper.AddParameter("@ProductGroupID", DBNull.Value );
// Pass the value of '_productCode' as parameter 'ProductCode' of the stored procedure.
if(_productCodeNonDefault!=null)
oDatabaseHelper.AddParameter("@ProductCode", _productCodeNonDefault);
else
oDatabaseHelper.AddParameter("@ProductCode", DBNull.Value );
// Pass the value of '_isAcceptBatch' as parameter 'IsAcceptBatch' of the stored procedure.
if(_isAcceptBatchNonDefault!=null)
oDatabaseHelper.AddParameter("@IsAcceptBatch", _isAcceptBatchNonDefault);
else
oDatabaseHelper.AddParameter("@IsAcceptBatch", DBNull.Value );
// Pass the value of '_productPrice' as parameter 'ProductPrice' of the stored procedure.
if(_productPriceNonDefault!=null)
oDatabaseHelper.AddParameter("@ProductPrice", _productPriceNonDefault);
else
oDatabaseHelper.AddParameter("@ProductPrice", DBNull.Value );
// Pass the value of '_isFixedPrice' as parameter 'IsFixedPrice' of the stored procedure.
if(_isFixedPriceNonDefault!=null)
oDatabaseHelper.AddParameter("@IsFixedPrice", _isFixedPriceNonDefault);
else
oDatabaseHelper.AddParameter("@IsFixedPrice", DBNull.Value );
// Pass the value of '_hasDiscount' as parameter 'HasDiscount' of the stored procedure.
if(_hasDiscountNonDefault!=null)
oDatabaseHelper.AddParameter("@HasDiscount", _hasDiscountNonDefault);
else
oDatabaseHelper.AddParameter("@HasDiscount", DBNull.Value );
// Pass the value of '_discountAmount' as parameter 'DiscountAmount' of the stored procedure.
if(_discountAmountNonDefault!=null)
oDatabaseHelper.AddParameter("@DiscountAmount", _discountAmountNonDefault);
else
oDatabaseHelper.AddParameter("@DiscountAmount", DBNull.Value );
// Pass the value of '_descountRatio' as parameter 'DescountRatio' of the stored procedure.
if(_descountRatioNonDefault!=null)
oDatabaseHelper.AddParameter("@DescountRatio", _descountRatioNonDefault);
else
oDatabaseHelper.AddParameter("@DescountRatio", DBNull.Value );
// Pass the value of '_isActive' as parameter 'IsActive' of the stored procedure.
if(_isActiveNonDefault!=null)
oDatabaseHelper.AddParameter("@IsActive", _isActiveNonDefault);
else
oDatabaseHelper.AddParameter("@IsActive", DBNull.Value );
// Pass the value of '_notes' as parameter 'Notes' of the stored procedure.
if(_notesNonDefault!=null)
oDatabaseHelper.AddParameter("@Notes", _notesNonDefault);
else
oDatabaseHelper.AddParameter("@Notes", DBNull.Value );
// Pass the value of '_minPrice' as parameter 'MinPrice' of the stored procedure.
if(_minPriceNonDefault!=null)
oDatabaseHelper.AddParameter("@MinPrice", _minPriceNonDefault);
else
oDatabaseHelper.AddParameter("@MinPrice", DBNull.Value );
// Pass the value of '_maxPrice' as parameter 'MaxPrice' of the stored procedure.
if(_maxPriceNonDefault!=null)
oDatabaseHelper.AddParameter("@MaxPrice", _maxPriceNonDefault);
else
oDatabaseHelper.AddParameter("@MaxPrice", DBNull.Value );
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
if(!getBackValues )
{
oDatabaseHelper.ExecuteScalar("gsp_BDProduct_Insert_WithDefaultValues", ref ExecutionState);
}
else
{
IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_BDProduct_Insert_WithDefaultValues_AndReturn", ref ExecutionState);
if (dr.Read())
{
PopulateObjectFromReader(this,dr);
}
dr.Close();
}
oDatabaseHelper.Dispose();
return ExecutionState;
}