/// <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 SelectOneWithBDSupplierAccountsUsingCreatedBy(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_SelectOneWithBDSupplierAccountsUsingCreatedBy", ref ExecutionState); if (dr.Read()) { obj = new ADUser(); PopulateObjectFromReader(obj, dr); dr.NextResult(); //Get the child records. obj.BDSupplierAccountCollectionUsingCreatedBy = BDSupplierAccount.PopulateObjectsFromReader(dr); } dr.Close(); oDatabaseHelper.Dispose(); return(obj); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDSupplierAccountPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDSupplierAccount</returns> public BDSupplierAccount SelectOne(BDSupplierAccountPrimaryKey pk) { _bDSupplierAccountWCF = new BDSupplierAccount(); _bDSupplierAccount = POS.DataLayer.BDSupplierAccountBase.SelectOne(new POS.DataLayer.BDSupplierAccountPrimaryKey(pk.SupplierAccountId)); _bDSupplierAccountWCF.SupplierAccountId = _bDSupplierAccount.SupplierAccountId; _bDSupplierAccountWCF.PurcaseInvoiceID = _bDSupplierAccount.PurcaseInvoiceID; _bDSupplierAccountWCF.PurchaseDate = _bDSupplierAccount.PurchaseDate; _bDSupplierAccountWCF.SupplierID = _bDSupplierAccount.SupplierID; _bDSupplierAccountWCF.InvoiceNumber = _bDSupplierAccount.InvoiceNumber; _bDSupplierAccountWCF.TotalPrice = _bDSupplierAccount.TotalPrice; _bDSupplierAccountWCF.PaidAmount = _bDSupplierAccount.PaidAmount; _bDSupplierAccountWCF.IsVoid = _bDSupplierAccount.IsVoid; _bDSupplierAccountWCF.RemainingAmount = _bDSupplierAccount.RemainingAmount; _bDSupplierAccountWCF.CreateDate = _bDSupplierAccount.CreateDate; _bDSupplierAccountWCF.CreatedBy = _bDSupplierAccount.CreatedBy; _bDSupplierAccountWCF.updateDate = _bDSupplierAccount.updateDate; _bDSupplierAccountWCF.UpdatedBy = _bDSupplierAccount.UpdatedBy; _bDSupplierAccountWCF.IsDeleted = _bDSupplierAccount.IsDeleted; _bDSupplierAccountWCF.DeleteDate = _bDSupplierAccount.DeleteDate; _bDSupplierAccountWCF.DeletedBy = _bDSupplierAccount.DeletedBy; _bDSupplierAccountWCF.Depit = _bDSupplierAccount.Depit; _bDSupplierAccountWCF.Credit = _bDSupplierAccount.Credit; _bDSupplierAccountWCF.LstDayToPay = _bDSupplierAccount.LstDayToPay; _bDSupplierAccountWCF.ChequeNumber = _bDSupplierAccount.ChequeNumber; _bDSupplierAccountWCF.InvoiceType = _bDSupplierAccount.InvoiceType; return _bDSupplierAccountWCF; }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDSupplierAccountPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDSupplierAccount</returns> public BDSupplierAccount SelectOne(BDSupplierAccountPrimaryKey pk) { _bDSupplierAccountWCF = new BDSupplierAccount(); _bDSupplierAccount = POS.DataLayer.BDSupplierAccountBase.SelectOne(new POS.DataLayer.BDSupplierAccountPrimaryKey(pk.SupplierAccountId)); _bDSupplierAccountWCF.SupplierAccountId = _bDSupplierAccount.SupplierAccountId; _bDSupplierAccountWCF.PurcaseInvoiceID = _bDSupplierAccount.PurcaseInvoiceID; _bDSupplierAccountWCF.PurchaseDate = _bDSupplierAccount.PurchaseDate; _bDSupplierAccountWCF.SupplierID = _bDSupplierAccount.SupplierID; _bDSupplierAccountWCF.InvoiceNumber = _bDSupplierAccount.InvoiceNumber; _bDSupplierAccountWCF.TotalPrice = _bDSupplierAccount.TotalPrice; _bDSupplierAccountWCF.PaidAmount = _bDSupplierAccount.PaidAmount; _bDSupplierAccountWCF.IsVoid = _bDSupplierAccount.IsVoid; _bDSupplierAccountWCF.RemainingAmount = _bDSupplierAccount.RemainingAmount; _bDSupplierAccountWCF.CreateDate = _bDSupplierAccount.CreateDate; _bDSupplierAccountWCF.CreatedBy = _bDSupplierAccount.CreatedBy; _bDSupplierAccountWCF.updateDate = _bDSupplierAccount.updateDate; _bDSupplierAccountWCF.UpdatedBy = _bDSupplierAccount.UpdatedBy; _bDSupplierAccountWCF.IsDeleted = _bDSupplierAccount.IsDeleted; _bDSupplierAccountWCF.DeleteDate = _bDSupplierAccount.DeleteDate; _bDSupplierAccountWCF.DeletedBy = _bDSupplierAccount.DeletedBy; _bDSupplierAccountWCF.InvoiceType = _bDSupplierAccount.InvoiceType; return(_bDSupplierAccountWCF); }
public bool SaveAccountUpdates(PURPurchaseHeader purchaseHeader, BDSupplierAccount supplierAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateSupplierAccount(oDatabaseHelper, supplierAccount, ExecutionState); if (!UpdatePurchaseHeader(oDatabaseHelper, purchaseHeader)) { ExecutionState = false; } else { ExecutionState = true; } if (ExecutionState) { oDatabaseHelper.CommitTransaction(); } else { oDatabaseHelper.RollbackTransaction(); } oDatabaseHelper.Dispose(); return(ExecutionState); }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDSupplierAccount" type="BDSupplierAccount">This BDSupplierAccount will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDSupplierAccount bDSupplierAccount) { _bDSupplierAccount = POS.DataLayer.BDSupplierAccount.SelectOne(new POS.DataLayer.BDSupplierAccountPrimaryKey(bDSupplierAccount.SupplierAccountId)); _bDSupplierAccount.PurcaseInvoiceID = bDSupplierAccount.PurcaseInvoiceID; _bDSupplierAccount.PurchaseDate = bDSupplierAccount.PurchaseDate; _bDSupplierAccount.SupplierID = bDSupplierAccount.SupplierID; _bDSupplierAccount.InvoiceNumber = bDSupplierAccount.InvoiceNumber; _bDSupplierAccount.TotalPrice = bDSupplierAccount.TotalPrice; _bDSupplierAccount.PaidAmount = bDSupplierAccount.PaidAmount; _bDSupplierAccount.IsVoid = bDSupplierAccount.IsVoid; _bDSupplierAccount.RemainingAmount = bDSupplierAccount.RemainingAmount; _bDSupplierAccount.CreateDate = bDSupplierAccount.CreateDate; _bDSupplierAccount.CreatedBy = bDSupplierAccount.CreatedBy; _bDSupplierAccount.updateDate = bDSupplierAccount.updateDate; _bDSupplierAccount.UpdatedBy = bDSupplierAccount.UpdatedBy; _bDSupplierAccount.IsDeleted = bDSupplierAccount.IsDeleted; _bDSupplierAccount.DeleteDate = bDSupplierAccount.DeleteDate; _bDSupplierAccount.DeletedBy = bDSupplierAccount.DeletedBy; _bDSupplierAccount.Depit = bDSupplierAccount.Depit; _bDSupplierAccount.Credit = bDSupplierAccount.Credit; _bDSupplierAccount.LstDayToPay = bDSupplierAccount.LstDayToPay; _bDSupplierAccount.ChequeNumber = bDSupplierAccount.ChequeNumber; _bDSupplierAccount.InvoiceType = bDSupplierAccount.InvoiceType; return(_bDSupplierAccount.Update()); }
public bool SaveAccountUpdates(PURPurchaseHeader purchaseHeader, BDSupplierAccount supplierAccount) { oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; oDatabaseHelper.BeginTransaction(); ExecutionState = UpdateSupplierAccount(oDatabaseHelper, supplierAccount, ExecutionState); if (!UpdatePurchaseHeader(oDatabaseHelper, purchaseHeader)) { ExecutionState = false; } else ExecutionState = true; if (ExecutionState) oDatabaseHelper.CommitTransaction(); else oDatabaseHelper.RollbackTransaction(); oDatabaseHelper.Dispose(); return ExecutionState; }
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; }
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); }
/// <summary> /// This method will insert one new row into the database using the property Information /// </summary> /// /// <param name="bDSupplierAccount" type="BDSupplierAccount">This BDSupplierAccount will be inserted in the database.</param> /// /// <returns>True if succeeded</returns> public bool Insert(BDSupplierAccount bDSupplierAccount) { _bDSupplierAccount = new POS.DataLayer.BDSupplierAccount(); _bDSupplierAccount.SupplierAccountId = bDSupplierAccount.SupplierAccountId; _bDSupplierAccount.PurcaseInvoiceID = bDSupplierAccount.PurcaseInvoiceID; _bDSupplierAccount.PurchaseDate = bDSupplierAccount.PurchaseDate; _bDSupplierAccount.SupplierID = bDSupplierAccount.SupplierID; _bDSupplierAccount.InvoiceNumber = bDSupplierAccount.InvoiceNumber; _bDSupplierAccount.TotalPrice = bDSupplierAccount.TotalPrice; _bDSupplierAccount.PaidAmount = bDSupplierAccount.PaidAmount; _bDSupplierAccount.IsVoid = bDSupplierAccount.IsVoid; _bDSupplierAccount.RemainingAmount = bDSupplierAccount.RemainingAmount; _bDSupplierAccount.CreateDate = bDSupplierAccount.CreateDate; _bDSupplierAccount.CreatedBy = bDSupplierAccount.CreatedBy; _bDSupplierAccount.updateDate = bDSupplierAccount.updateDate; _bDSupplierAccount.UpdatedBy = bDSupplierAccount.UpdatedBy; _bDSupplierAccount.IsDeleted = bDSupplierAccount.IsDeleted; _bDSupplierAccount.DeleteDate = bDSupplierAccount.DeleteDate; _bDSupplierAccount.DeletedBy = bDSupplierAccount.DeletedBy; _bDSupplierAccount.InvoiceType = bDSupplierAccount.InvoiceType; return(_bDSupplierAccount.Insert()); }
///<summary> /// This method will update one new row into the database using the property Information /// </summary> /// /// <param name="bDSupplierAccount" type="BDSupplierAccount">This BDSupplierAccount will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDSupplierAccount bDSupplierAccount) { _bDSupplierAccount=POS.DataLayer.BDSupplierAccount.SelectOne(new POS.DataLayer.BDSupplierAccountPrimaryKey(bDSupplierAccount.SupplierAccountId)); _bDSupplierAccount.PurcaseInvoiceID=bDSupplierAccount.PurcaseInvoiceID; _bDSupplierAccount.PurchaseDate=bDSupplierAccount.PurchaseDate; _bDSupplierAccount.SupplierID=bDSupplierAccount.SupplierID; _bDSupplierAccount.InvoiceNumber=bDSupplierAccount.InvoiceNumber; _bDSupplierAccount.TotalPrice=bDSupplierAccount.TotalPrice; _bDSupplierAccount.PaidAmount=bDSupplierAccount.PaidAmount; _bDSupplierAccount.IsVoid=bDSupplierAccount.IsVoid; _bDSupplierAccount.RemainingAmount=bDSupplierAccount.RemainingAmount; _bDSupplierAccount.CreateDate=bDSupplierAccount.CreateDate; _bDSupplierAccount.CreatedBy=bDSupplierAccount.CreatedBy; _bDSupplierAccount.updateDate=bDSupplierAccount.updateDate; _bDSupplierAccount.UpdatedBy=bDSupplierAccount.UpdatedBy; _bDSupplierAccount.IsDeleted=bDSupplierAccount.IsDeleted; _bDSupplierAccount.DeleteDate=bDSupplierAccount.DeleteDate; _bDSupplierAccount.DeletedBy=bDSupplierAccount.DeletedBy; _bDSupplierAccount.Depit=bDSupplierAccount.Depit; _bDSupplierAccount.Credit=bDSupplierAccount.Credit; _bDSupplierAccount.LstDayToPay=bDSupplierAccount.LstDayToPay; _bDSupplierAccount.ChequeNumber=bDSupplierAccount.ChequeNumber; _bDSupplierAccount.InvoiceType=bDSupplierAccount.InvoiceType; return _bDSupplierAccount.Update(); }