/// <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; }
public bool SaveAccountUpdates(BDSupplierAccount _supplierAccount) { #region select area PURPurchaseHeaderPrimaryKey purchaseHeaderpk = new PURPurchaseHeaderPrimaryKey(); purchaseHeaderpk.PurcaseHeaderID = _supplierAccount.PurcaseInvoiceID; PURPurchaseHeader _pURPurchaseHeader = _purchaseHeaderService.SelectOne(purchaseHeaderpk); BDSupplierAccountPrimaryKey supplierAccountpk = new BDSupplierAccountPrimaryKey(); supplierAccountpk.SupplierAccountId = _supplierAccount.SupplierAccountId; BDSupplierAccount supplierAccount = SelectOne(supplierAccountpk); #endregion #region supplier account area POS.DataLayer.BDSupplierAccount supplierAccountDal = new POS.DataLayer.BDSupplierAccount(); supplierAccountDal.CreateDate = supplierAccount.CreateDate; supplierAccountDal.CreatedBy = supplierAccount.CreatedBy; supplierAccountDal.DeleteDate = supplierAccount.DeleteDate; supplierAccountDal.DeletedBy = supplierAccount.DeletedBy; supplierAccountDal.InvoiceNumber = supplierAccount.InvoiceNumber; supplierAccountDal.IsDeleted = supplierAccount.IsDeleted; supplierAccountDal.IsVoid = supplierAccount.IsVoid; supplierAccountDal.PurcaseInvoiceID = supplierAccount.PurcaseInvoiceID; supplierAccountDal.PurchaseDate = supplierAccount.PurchaseDate; supplierAccountDal.SupplierAccountId = supplierAccount.SupplierAccountId; supplierAccountDal.SupplierID = supplierAccount.SupplierID; supplierAccountDal.updateDate = supplierAccount.updateDate; supplierAccountDal.UpdatedBy = supplierAccount.UpdatedBy; ////////// Updated area supplierAccountDal.PaidAmount = _supplierAccount.PaidAmount; supplierAccountDal.RemainingAmount = _supplierAccount.RemainingAmount; supplierAccountDal.TotalPrice = _supplierAccount.TotalPrice; #endregion #region purchase area POS.DataLayer.PURPurchaseHeader _purchaseHeaderDAL = new POS.DataLayer.PURPurchaseHeader(); _purchaseHeaderDAL.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID; _purchaseHeaderDAL.PurchaseDate = _pURPurchaseHeader.PurchaseDate; _purchaseHeaderDAL.SupplierID = _pURPurchaseHeader.SupplierID; _purchaseHeaderDAL.SupplierName = _pURPurchaseHeader.SupplierName; _purchaseHeaderDAL.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber; _purchaseHeaderDAL.InvoiceDate = _pURPurchaseHeader.InvoiceDate; _purchaseHeaderDAL.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID; _purchaseHeaderDAL.LastDayToPay = _pURPurchaseHeader.LastDayToPay; _purchaseHeaderDAL.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount; _purchaseHeaderDAL.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio; _purchaseHeaderDAL.IsClosed = _pURPurchaseHeader.IsClosed; _purchaseHeaderDAL.IsVoid = _pURPurchaseHeader.IsVoid; _purchaseHeaderDAL.IsPrinted = _pURPurchaseHeader.IsPrinted; _purchaseHeaderDAL.ServicePrice = _pURPurchaseHeader.ServicePrice; _purchaseHeaderDAL.TaxTypeID = _pURPurchaseHeader.TaxTypeID; _purchaseHeaderDAL.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID; _purchaseHeaderDAL.CreatedBy = _pURPurchaseHeader.CreatedBy; _purchaseHeaderDAL.CreateDate = _pURPurchaseHeader.CreateDate; _purchaseHeaderDAL.UpdatedBy = _pURPurchaseHeader.UpdatedBy; _purchaseHeaderDAL.updateDate = _pURPurchaseHeader.updateDate; _purchaseHeaderDAL.IsDeleted = _pURPurchaseHeader.IsDeleted; _purchaseHeaderDAL.DeletedBy = _pURPurchaseHeader.DeletedBy; _purchaseHeaderDAL.DeleteDate = _pURPurchaseHeader.DeleteDate; ///////////// updated area _purchaseHeaderDAL.TotalPrice = _supplierAccount.TotalPrice; _purchaseHeaderDAL.PaidAmount = _supplierAccount.PaidAmount; _purchaseHeaderDAL.RemainingAmount = _supplierAccount.RemainingAmount; #endregion POS.DataLayer.BDSupplierAccount supplierAccountObj = new DataLayer.BDSupplierAccount(); return(supplierAccountObj.SaveAccountUpdates(_purchaseHeaderDAL, supplierAccountDal)); }
/// <summary> /// This method will return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class BDSupplierAccount in the form of object of BDSupplierAccountCollection </returns> public BDSupplierAccountCollection SelectAll() { BDSupplierAccountCollection bDSupplierAccountCollection = new BDSupplierAccountCollection(); foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAll()) { _bDSupplierAccountWCF = new BDSupplierAccount(); _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; bDSupplierAccountCollection.Add(_bDSupplierAccountWCF); } return bDSupplierAccountCollection; }
///<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(); }
/// <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 BDSupplierAccount</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 BDSupplierAccount in the form of an object of class BDSupplierAccountCollection</returns> public BDSupplierAccountCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { BDSupplierAccountCollection bDSupplierAccountCollection = new BDSupplierAccountCollection(); foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement)) { _bDSupplierAccountWCF = new BDSupplierAccount(); _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; bDSupplierAccountCollection.Add(_bDSupplierAccountWCF); } return bDSupplierAccountCollection; }
/// <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="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// <param name="pageSize" type="int">Number of records returned.</param> /// <param name="skipPages" type="int">The number of missing pages.</param> /// <param name="orderByStatement" type="string">The field value to number.</param> /// /// <returns>object of class BDSupplierAccountCollection</returns> public BDSupplierAccountCollection SelectAllByForeignKeyPurcaseInvoiceIDPaged(PURPurchaseHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement) { BDSupplierAccountCollection bDSupplierAccountCollection=new BDSupplierAccountCollection(); foreach (POS.DataLayer.BDSupplierAccount _bDSupplierAccount in POS.DataLayer.BDSupplierAccountBase.SelectAllByForeignKeyPurcaseInvoiceIDPaged(new POS.DataLayer.PURPurchaseHeaderPrimaryKey(pk.PurcaseHeaderID), pageSize, skipPages, orderByStatement)) { _bDSupplierAccountWCF = new BDSupplierAccount(); _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; bDSupplierAccountCollection.Add(_bDSupplierAccountWCF); } return bDSupplierAccountCollection; }
public bool SaveAccountUpdates( BDSupplierAccount _supplierAccount) { #region select area PURPurchaseHeaderPrimaryKey purchaseHeaderpk = new PURPurchaseHeaderPrimaryKey(); purchaseHeaderpk.PurcaseHeaderID = _supplierAccount.PurcaseInvoiceID; PURPurchaseHeader _pURPurchaseHeader = _purchaseHeaderService.SelectOne(purchaseHeaderpk); BDSupplierAccountPrimaryKey supplierAccountpk = new BDSupplierAccountPrimaryKey(); supplierAccountpk.SupplierAccountId = _supplierAccount.SupplierAccountId; BDSupplierAccount supplierAccount = SelectOne(supplierAccountpk); #endregion #region supplier account area POS.DataLayer.BDSupplierAccount supplierAccountDal = new POS.DataLayer.BDSupplierAccount(); supplierAccountDal.CreateDate = supplierAccount.CreateDate ; supplierAccountDal.CreatedBy = supplierAccount.CreatedBy ; supplierAccountDal.DeleteDate = supplierAccount.DeleteDate ; supplierAccountDal.DeletedBy = supplierAccount.DeletedBy ; supplierAccountDal.InvoiceNumber = supplierAccount.InvoiceNumber ; supplierAccountDal.IsDeleted = supplierAccount.IsDeleted ; supplierAccountDal.IsVoid = supplierAccount.IsVoid ; supplierAccountDal.PurcaseInvoiceID = supplierAccount.PurcaseInvoiceID ; supplierAccountDal.PurchaseDate = supplierAccount.PurchaseDate ; supplierAccountDal.SupplierAccountId = supplierAccount.SupplierAccountId ; supplierAccountDal.SupplierID = supplierAccount.SupplierID ; supplierAccountDal.updateDate = supplierAccount.updateDate; supplierAccountDal.UpdatedBy = supplierAccount.UpdatedBy; ////////// Updated area supplierAccountDal.PaidAmount = _supplierAccount.PaidAmount; supplierAccountDal.RemainingAmount = _supplierAccount.RemainingAmount; supplierAccountDal.TotalPrice = _supplierAccount.TotalPrice; #endregion #region purchase area POS.DataLayer.PURPurchaseHeader _purchaseHeaderDAL = new POS.DataLayer.PURPurchaseHeader(); _purchaseHeaderDAL.PurcaseHeaderID = _pURPurchaseHeader.PurcaseHeaderID; _purchaseHeaderDAL.PurchaseDate = _pURPurchaseHeader.PurchaseDate; _purchaseHeaderDAL.SupplierID = _pURPurchaseHeader.SupplierID; _purchaseHeaderDAL.SupplierName = _pURPurchaseHeader.SupplierName; _purchaseHeaderDAL.InvoiceNumber = _pURPurchaseHeader.InvoiceNumber; _purchaseHeaderDAL.InvoiceDate = _pURPurchaseHeader.InvoiceDate; _purchaseHeaderDAL.PaymentTypeID = _pURPurchaseHeader.PaymentTypeID; _purchaseHeaderDAL.LastDayToPay = _pURPurchaseHeader.LastDayToPay; _purchaseHeaderDAL.TotalDiscountAmount = _pURPurchaseHeader.TotalDiscountAmount; _purchaseHeaderDAL.TotalDiscountRatio = _pURPurchaseHeader.TotalDiscountRatio; _purchaseHeaderDAL.IsClosed = _pURPurchaseHeader.IsClosed; _purchaseHeaderDAL.IsVoid = _pURPurchaseHeader.IsVoid; _purchaseHeaderDAL.IsPrinted = _pURPurchaseHeader.IsPrinted; _purchaseHeaderDAL.ServicePrice = _pURPurchaseHeader.ServicePrice; _purchaseHeaderDAL.TaxTypeID = _pURPurchaseHeader.TaxTypeID; _purchaseHeaderDAL.RefuseReasonID = _pURPurchaseHeader.RefuseReasonID; _purchaseHeaderDAL.CreatedBy = _pURPurchaseHeader.CreatedBy; _purchaseHeaderDAL.CreateDate = _pURPurchaseHeader.CreateDate; _purchaseHeaderDAL.UpdatedBy = _pURPurchaseHeader.UpdatedBy; _purchaseHeaderDAL.updateDate = _pURPurchaseHeader.updateDate; _purchaseHeaderDAL.IsDeleted = _pURPurchaseHeader.IsDeleted; _purchaseHeaderDAL.DeletedBy = _pURPurchaseHeader.DeletedBy; _purchaseHeaderDAL.DeleteDate = _pURPurchaseHeader.DeleteDate; ///////////// updated area _purchaseHeaderDAL.TotalPrice = _supplierAccount.TotalPrice; _purchaseHeaderDAL.PaidAmount = _supplierAccount.PaidAmount; _purchaseHeaderDAL.RemainingAmount = _supplierAccount.RemainingAmount; #endregion POS.DataLayer.BDSupplierAccount supplierAccountObj = new DataLayer.BDSupplierAccount(); return supplierAccountObj.SaveAccountUpdates(_purchaseHeaderDAL, supplierAccountDal); }