/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLinePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLine</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:55:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static INVTakingInventoryLine SelectOne(INVTakingInventoryLinePrimaryKey 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); IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_INVTakingInventoryLine_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, dr); dr.Close(); oDatabaseHelper.Dispose(); return(obj); } else { dr.Close(); oDatabaseHelper.Dispose(); return(null); } }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of INVTakingInventoryLineCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:55:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineCollection PopulateObjectsFromReader(IDataReader rdr) { INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); while (rdr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } return(list); }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLine" type="INVTakingInventoryLine">This INVTakingInventoryLine will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(INVTakingInventoryLine iNVTakingInventoryLine) { _iNVTakingInventoryLine = POS.DataLayer.INVTakingInventoryLine.SelectOne(new POS.DataLayer.INVTakingInventoryLinePrimaryKey(iNVTakingInventoryLine.TakingLineID)); _iNVTakingInventoryLine.TakingHeaderID = iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLine.ProductID = iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLine.ActualQty = iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLine.ExpectedQty = iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLine.CreatedBy = iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLine.CreateDate = iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLine.UpdatedBy = iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLine.UpdateDate = iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLine.IsDeleted = iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLine.DeletedBy = iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLine.DeleteDate = iNVTakingInventoryLine.DeleteDate; return(_iNVTakingInventoryLine.Update()); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLine" type="INVTakingInventoryLine">This INVTakingInventoryLine will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(INVTakingInventoryLine iNVTakingInventoryLine) { _iNVTakingInventoryLine = new POS.DataLayer.INVTakingInventoryLine(); _iNVTakingInventoryLine.TakingLineID = iNVTakingInventoryLine.TakingLineID; _iNVTakingInventoryLine.TakingHeaderID = iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLine.ProductID = iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLine.ActualQty = iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLine.ExpectedQty = iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLine.CreatedBy = iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLine.CreateDate = iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLine.UpdatedBy = iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLine.UpdateDate = iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLine.IsDeleted = iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLine.DeletedBy = iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLine.DeleteDate = iNVTakingInventoryLine.DeleteDate; return(_iNVTakingInventoryLine.Insert()); }
public INVTakingInventoryLineCollection GetLines(int HeaderID) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("TakingHeaderID", HeaderID); // oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr = oDatabaseHelper.ExecuteReader("usp_INVTakingInventory_GetLines", ref ExecutionState); INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); while (dr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); obj.TakingLineID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.TakingLineID)); if (!dr.IsDBNull(dr.GetOrdinal("TakingLineBatchID"))) { obj.TakingLineBatchID = dr.GetInt32(dr.GetOrdinal("TakingLineBatchID")); } obj.ProductID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.ProductID)); obj.ProductName = dr.GetString(dr.GetOrdinal("ProductName")); obj.StockTypeName = dr.GetString(dr.GetOrdinal("StockTypeName")); obj.ExpectedQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ExpectedQty)); obj.ActualQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ActualQty)); obj.IsAcceptBatch = dr.GetBoolean(dr.GetOrdinal("IsAcceptBatch")); if (!dr.IsDBNull(dr.GetOrdinal("BatchNumber"))) { obj.BatchNumber = dr.GetString(dr.GetOrdinal("BatchNumber")); } if (!dr.IsDBNull(dr.GetOrdinal("ExpiryDate"))) { obj.ExpiryDate = dr.GetDateTime(dr.GetOrdinal("ExpiryDate")); } list.Add(obj); } dr.Close(); oDatabaseHelper.Dispose(); return(list); //usp_INVTakingInventory_GetNotCommited }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLinePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLine</returns> public INVTakingInventoryLine SelectOne(INVTakingInventoryLinePrimaryKey pk) { _iNVTakingInventoryLineWCF = new INVTakingInventoryLine(); _iNVTakingInventoryLine = POS.DataLayer.INVTakingInventoryLineBase.SelectOne(new POS.DataLayer.INVTakingInventoryLinePrimaryKey(pk.TakingLineID)); _iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID; _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLineWCF.CreatedBy = _iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLineWCF.CreateDate = _iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLineWCF.UpdatedBy = _iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLineWCF.UpdateDate = _iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLineWCF.IsDeleted = _iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLineWCF.DeletedBy = _iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLineWCF.DeleteDate = _iNVTakingInventoryLine.DeleteDate; return(_iNVTakingInventoryLineWCF); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLinePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLine</returns> public INVTakingInventoryLine SelectOne(INVTakingInventoryLinePrimaryKey pk) { _iNVTakingInventoryLineWCF = new INVTakingInventoryLine(); _iNVTakingInventoryLine = POS.DataLayer.INVTakingInventoryLineBase.SelectOne(new POS.DataLayer.INVTakingInventoryLinePrimaryKey(pk.TakingLineID)); _iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID; _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLineWCF.CreatedBy = _iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLineWCF.CreateDate = _iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLineWCF.UpdatedBy = _iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLineWCF.UpdateDate = _iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLineWCF.IsDeleted = _iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLineWCF.DeletedBy = _iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLineWCF.DeleteDate = _iNVTakingInventoryLine.DeleteDate; _iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID; return _iNVTakingInventoryLineWCF; }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of INVTakingInventoryLineCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 12/27/2014 6:55:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); if (rdr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return(list); } else { oDatabaseHelper.Dispose(); return(null); } }
public INVTakingInventoryLineCollection GetLines(int HeaderID) { INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection(); foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in new POS.DataLayer.INVTakingInventoryLine().GetLines(HeaderID)) { _iNVTakingInventoryLineWCF = new INVTakingInventoryLine(); _iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID; _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLineWCF.ProductName = _iNVTakingInventoryLine.ProductName; _iNVTakingInventoryLineWCF.IsAcceptBatch = _iNVTakingInventoryLine.IsAcceptBatch; _iNVTakingInventoryLineWCF.TakingLineBatchID = _iNVTakingInventoryLine.TakingLineBatchID; _iNVTakingInventoryLineWCF.BatchNumber = _iNVTakingInventoryLine.BatchNumber; _iNVTakingInventoryLineWCF.ExpiryDate = _iNVTakingInventoryLine.ExpiryDate; _iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID; _iNVTakingInventoryLineWCF.StockTypeName = _iNVTakingInventoryLine.StockTypeName; iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF); } return iNVTakingInventoryLineCollection; }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLine" type="INVTakingInventoryLine">This INVTakingInventoryLine will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(INVTakingInventoryLine iNVTakingInventoryLine) { _iNVTakingInventoryLine=POS.DataLayer.INVTakingInventoryLine.SelectOne(new POS.DataLayer.INVTakingInventoryLinePrimaryKey(iNVTakingInventoryLine.TakingLineID)); _iNVTakingInventoryLine.TakingHeaderID=iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLine.ProductID=iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLine.ActualQty=iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLine.ExpectedQty=iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLine.CreatedBy=iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLine.CreateDate=iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLine.UpdatedBy=iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLine.UpdateDate=iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLine.IsDeleted=iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLine.DeletedBy=iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLine.DeleteDate=iNVTakingInventoryLine.DeleteDate; _iNVTakingInventoryLine.StockTypeID=iNVTakingInventoryLine.StockTypeID; return _iNVTakingInventoryLine.Update(); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="iNVTakingInventoryLine" type="INVTakingInventoryLine">This INVTakingInventoryLine will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(INVTakingInventoryLine iNVTakingInventoryLine) { _iNVTakingInventoryLine = new POS.DataLayer.INVTakingInventoryLine(); _iNVTakingInventoryLine.TakingLineID=iNVTakingInventoryLine.TakingLineID; _iNVTakingInventoryLine.TakingHeaderID=iNVTakingInventoryLine.TakingHeaderID; _iNVTakingInventoryLine.ProductID=iNVTakingInventoryLine.ProductID; _iNVTakingInventoryLine.ActualQty=iNVTakingInventoryLine.ActualQty; _iNVTakingInventoryLine.ExpectedQty=iNVTakingInventoryLine.ExpectedQty; _iNVTakingInventoryLine.CreatedBy=iNVTakingInventoryLine.CreatedBy; _iNVTakingInventoryLine.CreateDate=iNVTakingInventoryLine.CreateDate; _iNVTakingInventoryLine.UpdatedBy=iNVTakingInventoryLine.UpdatedBy; _iNVTakingInventoryLine.UpdateDate=iNVTakingInventoryLine.UpdateDate; _iNVTakingInventoryLine.IsDeleted=iNVTakingInventoryLine.IsDeleted; _iNVTakingInventoryLine.DeletedBy=iNVTakingInventoryLine.DeletedBy; _iNVTakingInventoryLine.DeleteDate=iNVTakingInventoryLine.DeleteDate; _iNVTakingInventoryLine.StockTypeID=iNVTakingInventoryLine.StockTypeID; return _iNVTakingInventoryLine.Insert(); }
public INVTakingInventoryLineCollection GetLines(int HeaderID) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("TakingHeaderID", HeaderID); // oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr = oDatabaseHelper.ExecuteReader("usp_INVTakingInventory_GetLines", ref ExecutionState); INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); while (dr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); obj.TakingLineID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.TakingLineID)); if (!dr.IsDBNull(dr.GetOrdinal("TakingLineBatchID"))) { obj.TakingLineBatchID = dr.GetInt32(dr.GetOrdinal("TakingLineBatchID")); } obj.ProductID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.ProductID)); obj.ProductName= dr.GetString(dr.GetOrdinal("ProductName")); obj.StockTypeName = dr.GetString(dr.GetOrdinal("StockTypeName")); obj.ExpectedQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ExpectedQty)); obj.ActualQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ActualQty)); obj.IsAcceptBatch = dr.GetBoolean(dr.GetOrdinal("IsAcceptBatch")); if (!dr.IsDBNull(dr.GetOrdinal("BatchNumber"))) obj.BatchNumber = dr.GetString(dr.GetOrdinal("BatchNumber")); if (!dr.IsDBNull(dr.GetOrdinal("ExpiryDate"))) obj.ExpiryDate = dr.GetDateTime(dr.GetOrdinal("ExpiryDate")); list.Add(obj); } dr.Close(); oDatabaseHelper.Dispose(); return list; //usp_INVTakingInventory_GetNotCommited }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="INVTakingInventoryLinePrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class INVTakingInventoryLine</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 27/4/2015 7:28:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static INVTakingInventoryLine SelectOne(INVTakingInventoryLinePrimaryKey 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); IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_INVTakingInventoryLine_SelectbyPrimaryKey", ref ExecutionState); if (dr.Read()) { INVTakingInventoryLine obj=new INVTakingInventoryLine(); PopulateObjectFromReader(obj,dr); dr.Close(); oDatabaseHelper.Dispose(); return obj; } else { dr.Close(); oDatabaseHelper.Dispose(); return null; } }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of INVTakingInventoryLineCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 27/4/2015 7:28:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) { INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); if (rdr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return list; } else { oDatabaseHelper.Dispose(); return null; } }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of INVTakingInventoryLineCollection</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 27/4/2015 7:28:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static INVTakingInventoryLineCollection PopulateObjectsFromReader(IDataReader rdr) { INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection(); while (rdr.Read()) { INVTakingInventoryLine obj = new INVTakingInventoryLine(); PopulateObjectFromReader(obj,rdr); list.Add(obj); } return list; }