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


C# DatabaseHelper.AddParameter方法代码示例

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


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

示例1: SelectByUserNameAndPassword

        public static ADUser SelectByUserNameAndPassword(string UserName, string Password)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            oDatabaseHelper.AddParameter("@UserName", UserName);
            oDatabaseHelper.AddParameter("@Password", Password);

            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_ADUser_SelectUserNameAndPassword", ref ExecutionState);
            if (dr.Read())
            {
                ADUser obj = new ADUser();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return obj;
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return null;
            }

        }
开发者ID:kimboox44,项目名称:POS,代码行数:28,代码来源:ADUser.cs

示例2: 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:12,代码来源:SALSalesReturnHeader.cs

示例3: 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;
 }
开发者ID:kimboox44,项目名称:POS,代码行数:16,代码来源:INVTransferHeader.cs

示例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;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:16,代码来源:INVBatch.cs

示例5: SearchByriteria

        public static VPurchaseReturnHeaderCollection SearchByriteria(string CustomerName, DateTime FromDate, DateTime ToDate, string InvoiceNumber)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;
            oDatabaseHelper.AddParameter("@SupplierName", CustomerName);
            oDatabaseHelper.AddParameter("@FromDate", FromDate);
            oDatabaseHelper.AddParameter("@DateTo", ToDate);
            oDatabaseHelper.AddParameter("@InvoiceNumber", InvoiceNumber);
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_VPurchaseReturnHeader_SearchByCriteria", ref ExecutionState);
            VPurchaseReturnHeaderCollection VPurchaseReturnHeaderCollection = PopulateObjectsFromReader(dr);
            dr.Close();
            oDatabaseHelper.Dispose();
            return VPurchaseReturnHeaderCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:17,代码来源:VPurchaseReturnHeader.cs

示例6: SearcByCriteria

        public static BDProductGroupCollection SearcByCriteria(string ProductGroupName)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@ProductGroupName", ProductGroupName);

            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_ProductGroup_SearchByCriteria", ref ExecutionState);
            BDProductGroupCollection BDProductGroupCollection = PopulateObjectsFromReader(dr);
            dr.Close();
            oDatabaseHelper.Dispose();
            return BDProductGroupCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:18,代码来源:BDProductGroup.cs

示例7: SelectAllProductsByGroupID

        public static BDProductCollection SelectAllProductsByGroupID(int InventoryID, BDProductGroupPrimaryKey pk)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;
            BDProductCollection obj = null;

            oDatabaseHelper.AddParameter("@ProductGroupID", pk.ProductGroupID);
            oDatabaseHelper.AddParameter("@InventoryID", InventoryID);
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_SelectAllByGroupID", ref ExecutionState);
            obj = new BDProductCollection();
            obj = PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper);

            dr.Close();
            oDatabaseHelper.Dispose();
            return obj;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:19,代码来源:BDProduct.cs

示例8: HeaderSearch

        public static SALSalesHeaderCollection HeaderSearch(string CustomerName, string InvoiceNumber)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@CustomerName", CustomerName);
            oDatabaseHelper.AddParameter("@InvoiceDate", null);
            oDatabaseHelper.AddParameter("@InvoiceNumber", InvoiceNumber);
            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_SALSalesHeader_SearchByCriteria", ref ExecutionState);
            SALSalesHeaderCollection SALSalesHeaderCollection = PopulateFromReader(dr);

            dr.Close();
            oDatabaseHelper.Dispose();
            return SALSalesHeaderCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:20,代码来源:SALSalesHeader.cs

示例9: SelectByInvoiceNumber

        public static VSALSalesOrderCollection SelectByInvoiceNumber(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@Field", field);
            oDatabaseHelper.AddParameter("@Value", fieldValue);
            oDatabaseHelper.AddParameter("@Value2", fieldValue2);
            oDatabaseHelper.AddParameter("@Operation", OperationCollection.Operation[(int)typeOperation]);

            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_VSALSalesOrder_SelectByField", ref ExecutionState);
            VSALSalesOrderCollection VSALSalesOrderCollection = PopulateObjectsFromReader(dr);
            dr.Close();
            oDatabaseHelper.Dispose();
            return VSALSalesOrderCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:21,代码来源:VSALSalesOrder.cs

示例10: HeaderSearch

        public static PURPurchaseHeaderCollection HeaderSearch(int InventoryID, DateTime FromDate, DateTime ToDate, string SupplierName, string InvoiceNumber)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // Pass the specified field and its value to the stored procedure.
            oDatabaseHelper.AddParameter("@InventoryID", InventoryID );
            oDatabaseHelper.AddParameter("@FromDate", FromDate);
            oDatabaseHelper.AddParameter("@ToDate", ToDate );
            if (SupplierName!="")
            {
                oDatabaseHelper.AddParameter("@SupplierName", SupplierName); 
            }
            if (InvoiceNumber != "")
            {
                oDatabaseHelper.AddParameter("@InvoiceNumber", InvoiceNumber);
            }
            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_PURPurchaseHeader_SearchByCriteria", ref ExecutionState);
            PURPurchaseHeaderCollection PURPurchaseHeaderCollection = PopulateFromReader(dr);

            dr.Close();
            oDatabaseHelper.Dispose();
            return PURPurchaseHeaderCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:28,代码来源:PURPurchaseHeader.cs

示例11: GetAllProductsForOpenningQuantities

        public static BDProductCollection GetAllProductsForOpenningQuantities(int InventoryID)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            oDatabaseHelper.AddParameter("@InventoryID", InventoryID);

            IDataReader dr = oDatabaseHelper.ExecuteReader("usp_GetopeningStockLine", ref ExecutionState);
            BDProductCollection BDProductCollection = BDProductBase.PopulateObjectsFromReader(dr);
            dr.Close();
            oDatabaseHelper.Dispose();
            return BDProductCollection;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:14,代码来源:BDProduct.cs

示例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:09 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public bool Update() 
		{
			bool ExecutionState = false;
			oDatabaseHelper = new DatabaseHelper();
			
			// Pass the value of '_adjustStockReasonID' as parameter 'AdjustStockReasonID' of the stored procedure.
			oDatabaseHelper.AddParameter("@AdjustStockReasonID", _adjustStockReasonIDNonDefault );
			
			// Pass the value of '_adjustStockreasonName' as parameter 'AdjustStockreasonName' of the stored procedure.
			oDatabaseHelper.AddParameter("@AdjustStockreasonName", _adjustStockreasonNameNonDefault );
			
			// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
			oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
			
			oDatabaseHelper.ExecuteScalar("gsp_INVAdjustStockReason_Update", ref ExecutionState);
			oDatabaseHelper.Dispose();
			return ExecutionState;
			
		}
开发者ID:kimboox44,项目名称:POS,代码行数:35,代码来源:INVAdjustStockReasonBase.cs

示例13: SelectOneWithBDCustomerAccountsUsingCreatedBy

		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="ADUserPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class ADUser</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:27 PM				Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static ADUser SelectOneWithBDCustomerAccountsUsingCreatedBy(ADUserPrimaryKey pk)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			ADUser obj=null;
			
			// 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);
			
			IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_ADUser_SelectOneWithBDCustomerAccountsUsingCreatedBy", ref ExecutionState);
			if (dr.Read())
			{
				obj= new ADUser();
				PopulateObjectFromReader(obj,dr);
				
				dr.NextResult();
				
				//Get the child records.
				obj.BDCustomerAccountCollectionUsingCreatedBy=BDCustomerAccount.PopulateObjectsFromReader(dr);
			}
			dr.Close();  
			oDatabaseHelper.Dispose();
			return obj;
			
		}
开发者ID:kimboox44,项目名称:POS,代码行数:51,代码来源:ADUserBase.cs

示例14: 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;
			
		}
开发者ID:kimboox44,项目名称:POS,代码行数:29,代码来源:ADUserBase.cs

示例15: SelectByFieldPaged

		/// <summary>
		/// This method will return a list of objects representing the specified number of entries from the specified record number in the table 
		/// using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class ADUser</param>
		/// <param name="fieldValue" type="object">Value for the field specified.</param>
		/// <param name="fieldValue2" type="object">Value for the field specified.</param>
		/// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		///
		/// <returns>List of object of class ADUser in the form of an object of class ADUserCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:27 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static ADUserCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			
			// Pass the specified field and its value to the stored procedure.
			oDatabaseHelper.AddParameter("@Field",field);
			oDatabaseHelper.AddParameter("@Value", fieldValue );
			oDatabaseHelper.AddParameter("@Value2", fieldValue2 );
			oDatabaseHelper.AddParameter("@Operation", OperationCollection.Operation[(int)typeOperation] );
			oDatabaseHelper.AddParameter("@PageSize",pageSize);
			oDatabaseHelper.AddParameter("@SkipPages", skipPages );
			oDatabaseHelper.AddParameter("@OrderByStatement", orderByStatement );
			
			// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
			oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
			
			IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_ADUser_SelectByFieldPaged", ref ExecutionState);
			ADUserCollection ADUserCollection = PopulateObjectsFromReader(dr);
			dr.Close();
			oDatabaseHelper.Dispose();
			return ADUserCollection;
			
		}
开发者ID:kimboox44,项目名称:POS,代码行数:49,代码来源:ADUserBase.cs


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