private bool UpdateStockItems(int jobID, Material material, string locationCode, int quantity, bool unallocateJob) { DataAccess objADO; StringBuilder sb = new StringBuilder(); string stockIDs = string.Empty; StockItem objStockItem = this[0] as StockItem; DateTime? dataRetrievedDate = objStockItem.DataRetrievedDate; if (this.UpdateInsideTransaction && this.StockDataAccess != null) { objADO = this.StockDataAccess; } else { objADO = new DataAccess(); } ArrayList colParameters = new ArrayList(); string strStoredProcedure = "updStockByMaterialAndJob"; colParameters.Add(new SqlParameter("@JobID", jobID)); colParameters.Add(new SqlParameter("@MaterialID", material.ID)); //Now pass in the Material's description .. in case there is no valid Material ID colParameters.Add(new SqlParameter("@MaterialDesc", material.Description)); colParameters.Add(new SqlParameter("@Quantity", quantity)); if (!string.IsNullOrEmpty(locationCode)) { colParameters.Add(new SqlParameter("@StockLocationCode", locationCode)); } if (unallocateJob) { colParameters.Add(new SqlParameter("@ClearJobID", 1)); } if (dataRetrievedDate != null && dataRetrievedDate != DateTime.MinValue) { colParameters.Add(new SqlParameter("@DataRetrieved", dataRetrievedDate)); } int intReturn = objADO.ExecuteSQL(strStoredProcedure, (SqlParameter[])colParameters.ToArray(typeof(SqlParameter))); if (!this.UpdateInsideTransaction) { objADO = null; } return (intReturn > 0); }
public bool PredicateDelegate(Material memberObject) { return memberObject.Description.ToUpper() == _description.ToUpper(); }