private void GetSalesOrderData(int salesHeaderID) { SALSalesHeaderPrimaryKey pk = new SALSalesHeaderPrimaryKey(); pk.SalesHeaderID = salesHeaderID; _sALSalesHeader = _sALSalesHeaderWrapper.SelectOne(pk); sALSalesLineCollection = _sALSalesLinerWrapper.SelectByField(salesHeaderID); }
/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="SALSalesHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class SALSalesHeader</returns> public SALSalesHeader SelectOne(SALSalesHeaderPrimaryKey pk) { _sALSalesHeaderWCF = new SALSalesHeader(); _sALSalesHeader = POS.DataLayer.SALSalesHeaderBase.SelectOne(new POS.DataLayer.SALSalesHeaderPrimaryKey(pk.SalesHeaderID)); _sALSalesHeaderWCF.SalesHeaderID = _sALSalesHeader.SalesHeaderID; _sALSalesHeaderWCF.SalesDate = _sALSalesHeader.SalesDate; _sALSalesHeaderWCF.CustomerID = _sALSalesHeader.CustomerID; _sALSalesHeaderWCF.InvoiceNumber = _sALSalesHeader.InvoiceNumber; _sALSalesHeaderWCF.InvoiceDate = _sALSalesHeader.InvoiceDate; _sALSalesHeaderWCF.SellerID = _sALSalesHeader.SellerID; _sALSalesHeaderWCF.PaymentTypeID = _sALSalesHeader.PaymentTypeID; _sALSalesHeaderWCF.TotalPrice = _sALSalesHeader.TotalPrice; _sALSalesHeaderWCF.PaidAmount = _sALSalesHeader.PaidAmount; _sALSalesHeaderWCF.RemainingAmount = _sALSalesHeader.RemainingAmount; _sALSalesHeaderWCF.LastDayToPay = _sALSalesHeader.LastDayToPay; _sALSalesHeaderWCF.TotalDiscountAmount = _sALSalesHeader.TotalDiscountAmount; _sALSalesHeaderWCF.TotalDiscountRatio = _sALSalesHeader.TotalDiscountRatio; _sALSalesHeaderWCF.IsClosed = _sALSalesHeader.IsClosed; _sALSalesHeaderWCF.IsVoid = _sALSalesHeader.IsVoid; _sALSalesHeaderWCF.IsPrinted = _sALSalesHeader.IsPrinted; _sALSalesHeaderWCF.ServicePrice = _sALSalesHeader.ServicePrice; _sALSalesHeaderWCF.TaxTypeID = _sALSalesHeader.TaxTypeID; _sALSalesHeaderWCF.RefuseReasonID = _sALSalesHeader.RefuseReasonID; _sALSalesHeaderWCF.CreatedBy = _sALSalesHeader.CreatedBy; _sALSalesHeaderWCF.CreateDate = _sALSalesHeader.CreateDate; _sALSalesHeaderWCF.UpdatedBy = _sALSalesHeader.UpdatedBy; _sALSalesHeaderWCF.UpdateDate = _sALSalesHeader.UpdateDate; _sALSalesHeaderWCF.IsDeleted = _sALSalesHeader.IsDeleted; _sALSalesHeaderWCF.DeletedBy = _sALSalesHeader.DeletedBy; _sALSalesHeaderWCF.DeletDate = _sALSalesHeader.DeletDate; _sALSalesHeaderWCF.InventoryID = _sALSalesHeader.InventoryID; _sALSalesHeaderWCF.FinalPrice = _sALSalesHeader.FinalPrice; _sALSalesHeaderWCF.ChequeNumber = _sALSalesHeader.ChequeNumber; return _sALSalesHeaderWCF; }
public bool SaveAccountUpdates(BDCustomerAccount _customerAccount) { #region select area SALSalesHeaderPrimaryKey purchaseHeaderpk = new SALSalesHeaderPrimaryKey(); purchaseHeaderpk.SalesHeaderID = _customerAccount.SalesInvoiceId; SALSalesHeader _salSalesHeader = _purchaseHeaderService.SelectOne(purchaseHeaderpk); BDCustomerAccountPrimaryKey customerAccountpk = new BDCustomerAccountPrimaryKey(); customerAccountpk.CustomerAccountNumber = _customerAccount.CustomerAccountNumber; BDCustomerAccount customerAccount = SelectOne(customerAccountpk); #endregion #region customer account area POS.DataLayer.BDCustomerAccount customerAccountDal = new POS.DataLayer.BDCustomerAccount(); customerAccountDal.CreateDate = customerAccount.CreateDate; customerAccountDal.CreatedBy = customerAccount.CreatedBy; customerAccountDal.DeletedDate = customerAccount.DeletedDate; customerAccountDal.DeletedBy = customerAccount.DeletedBy; customerAccountDal.InvoiceNumber = customerAccount.InvoiceNumber; customerAccountDal.IsDeleted = customerAccount.IsDeleted; customerAccountDal.IsVoid = customerAccount.IsVoid; customerAccountDal.SalesInvoiceId = customerAccount.SalesInvoiceId; customerAccountDal.SalesDate = customerAccount.SalesDate; customerAccountDal.CustomerAccountNumber = customerAccount.CustomerAccountNumber; customerAccountDal.CustomerID = customerAccount.CustomerID; customerAccountDal.UpdateDate = customerAccount.UpdateDate; customerAccountDal.UpdatedBy = customerAccount.UpdatedBy; ////////// Updated area customerAccountDal.PaidAmount = _customerAccount.PaidAmount; customerAccountDal.RemainingAmount = _customerAccount.RemainingAmount; customerAccountDal.TotalPrice = _customerAccount.TotalPrice; #endregion #region purchase area POS.DataLayer.SALSalesHeader _purchaseHeaderDAL = new POS.DataLayer.SALSalesHeader(); _purchaseHeaderDAL.SalesHeaderID = _salSalesHeader.SalesHeaderID; _purchaseHeaderDAL.SalesDate = _salSalesHeader.SalesDate; _purchaseHeaderDAL.CustomerID = _salSalesHeader.CustomerID; _purchaseHeaderDAL.CustomerName = _salSalesHeader.CustomerName; _purchaseHeaderDAL.InvoiceNumber = _salSalesHeader.InvoiceNumber; _purchaseHeaderDAL.InvoiceDate = _salSalesHeader.InvoiceDate; _purchaseHeaderDAL.SellerID = _salSalesHeader.SellerID; _purchaseHeaderDAL.PaymentTypeID = _salSalesHeader.PaymentTypeID; _purchaseHeaderDAL.LastDayToPay = _salSalesHeader.LastDayToPay; _purchaseHeaderDAL.TotalDiscountAmount = _salSalesHeader.TotalDiscountAmount; _purchaseHeaderDAL.TotalDiscountRatio = _salSalesHeader.TotalDiscountRatio; _purchaseHeaderDAL.IsClosed = _salSalesHeader.IsClosed; _purchaseHeaderDAL.IsVoid = _salSalesHeader.IsVoid; _purchaseHeaderDAL.IsPrinted = _salSalesHeader.IsPrinted; _purchaseHeaderDAL.ServicePrice = _salSalesHeader.ServicePrice; _purchaseHeaderDAL.TaxTypeID = _salSalesHeader.TaxTypeID; _purchaseHeaderDAL.RefuseReasonID = _salSalesHeader.RefuseReasonID; _purchaseHeaderDAL.CreatedBy = _salSalesHeader.CreatedBy; _purchaseHeaderDAL.CreateDate = _salSalesHeader.CreateDate; _purchaseHeaderDAL.UpdatedBy = _salSalesHeader.UpdatedBy; _purchaseHeaderDAL.UpdateDate = _salSalesHeader.UpdateDate; _purchaseHeaderDAL.IsDeleted = _salSalesHeader.IsDeleted; _purchaseHeaderDAL.DeletedBy = _salSalesHeader.DeletedBy; _purchaseHeaderDAL.DeletDate = _salSalesHeader.DeletDate; ///////////// updated area _purchaseHeaderDAL.TotalPrice = _customerAccount.TotalPrice; _purchaseHeaderDAL.PaidAmount = _customerAccount.PaidAmount; _purchaseHeaderDAL.RemainingAmount = _customerAccount.RemainingAmount; #endregion POS.DataLayer.BDCustomerAccount customerAccountObj = new DataLayer.BDCustomerAccount(); return(customerAccountObj.SaveAccountUpdates(_purchaseHeaderDAL, customerAccountDal)); }
public bool SaveAccountUpdates(BDCustomerAccount _customerAccount) { #region select area SALSalesHeaderPrimaryKey purchaseHeaderpk = new SALSalesHeaderPrimaryKey(); purchaseHeaderpk.SalesHeaderID = _customerAccount.SalesInvoiceId; SALSalesHeader _salSalesHeader = _purchaseHeaderService.SelectOne(purchaseHeaderpk); BDCustomerAccountPrimaryKey customerAccountpk = new BDCustomerAccountPrimaryKey(); customerAccountpk.CustomerAccountNumber = _customerAccount.CustomerAccountNumber; BDCustomerAccount customerAccount = SelectOne(customerAccountpk); #endregion #region customer account area POS.DataLayer.BDCustomerAccount customerAccountDal = new POS.DataLayer.BDCustomerAccount(); customerAccountDal.CreateDate = customerAccount.CreateDate; customerAccountDal.CreatedBy = customerAccount.CreatedBy; customerAccountDal.DeletedDate = customerAccount.DeletedDate; customerAccountDal.DeletedBy = customerAccount.DeletedBy; customerAccountDal.InvoiceNumber = customerAccount.InvoiceNumber; customerAccountDal.IsDeleted = customerAccount.IsDeleted; customerAccountDal.IsVoid = customerAccount.IsVoid; customerAccountDal.SalesInvoiceId = customerAccount.SalesInvoiceId; customerAccountDal.SalesDate = customerAccount.SalesDate; customerAccountDal.CustomerAccountNumber = customerAccount.CustomerAccountNumber; customerAccountDal.CustomerID = customerAccount.CustomerID; customerAccountDal.UpdateDate = customerAccount.UpdateDate; customerAccountDal.UpdatedBy = customerAccount.UpdatedBy; ////////// Updated area customerAccountDal.PaidAmount = _customerAccount.PaidAmount; customerAccountDal.RemainingAmount = _customerAccount.RemainingAmount; customerAccountDal.TotalPrice = _customerAccount.TotalPrice; #endregion #region purchase area POS.DataLayer.SALSalesHeader _purchaseHeaderDAL = new POS.DataLayer.SALSalesHeader(); _purchaseHeaderDAL.SalesHeaderID = _salSalesHeader.SalesHeaderID; _purchaseHeaderDAL.SalesDate = _salSalesHeader.SalesDate; _purchaseHeaderDAL.CustomerID = _salSalesHeader.CustomerID; _purchaseHeaderDAL.CustomerName = _salSalesHeader.CustomerName; _purchaseHeaderDAL.InvoiceNumber = _salSalesHeader.InvoiceNumber; _purchaseHeaderDAL.InvoiceDate = _salSalesHeader.InvoiceDate; _purchaseHeaderDAL.SellerID = _salSalesHeader.SellerID; _purchaseHeaderDAL.PaymentTypeID = _salSalesHeader.PaymentTypeID; _purchaseHeaderDAL.LastDayToPay = _salSalesHeader.LastDayToPay; _purchaseHeaderDAL.TotalDiscountAmount = _salSalesHeader.TotalDiscountAmount; _purchaseHeaderDAL.TotalDiscountRatio = _salSalesHeader.TotalDiscountRatio; _purchaseHeaderDAL.IsClosed = _salSalesHeader.IsClosed; _purchaseHeaderDAL.IsVoid = _salSalesHeader.IsVoid; _purchaseHeaderDAL.IsPrinted = _salSalesHeader.IsPrinted; _purchaseHeaderDAL.ServicePrice = _salSalesHeader.ServicePrice; _purchaseHeaderDAL.TaxTypeID = _salSalesHeader.TaxTypeID; _purchaseHeaderDAL.RefuseReasonID = _salSalesHeader.RefuseReasonID; _purchaseHeaderDAL.CreatedBy = _salSalesHeader.CreatedBy; _purchaseHeaderDAL.CreateDate = _salSalesHeader.CreateDate; _purchaseHeaderDAL.UpdatedBy = _salSalesHeader.UpdatedBy; _purchaseHeaderDAL.UpdateDate = _salSalesHeader.UpdateDate; _purchaseHeaderDAL.IsDeleted = _salSalesHeader.IsDeleted; _purchaseHeaderDAL.DeletedBy = _salSalesHeader.DeletedBy; _purchaseHeaderDAL.DeletDate = _salSalesHeader.DeletDate; ///////////// updated area _purchaseHeaderDAL.TotalPrice = _customerAccount.TotalPrice; _purchaseHeaderDAL.PaidAmount = _customerAccount.PaidAmount; _purchaseHeaderDAL.RemainingAmount = _customerAccount.RemainingAmount; #endregion POS.DataLayer.BDCustomerAccount customerAccountObj = new DataLayer.BDCustomerAccount(); return customerAccountObj.SaveAccountUpdates(_purchaseHeaderDAL, customerAccountDal); }
///<summary> ///This method will Delete the object from the database ///</summary> ///<param name="pk" type="SALSalesHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// <returns>True if succeeded</returns> public bool Delete(SALSalesHeaderPrimaryKey pk) { return POS.DataLayer.SALSalesHeaderBase.Delete(new POS.DataLayer.SALSalesHeaderPrimaryKey(pk.SalesHeaderID)); }
/// <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="SALSalesHeaderPrimaryKey">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 BDCustomerAccountCollection</returns> public BDCustomerAccountCollection SelectAllByForeignKeySalesInvoiceIdPaged(SALSalesHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement) { BDCustomerAccountCollection bDCustomerAccountCollection=new BDCustomerAccountCollection(); foreach (POS.DataLayer.BDCustomerAccount _bDCustomerAccount in POS.DataLayer.BDCustomerAccountBase.SelectAllByForeignKeySalesInvoiceIdPaged(new POS.DataLayer.SALSalesHeaderPrimaryKey(pk.SalesHeaderID), pageSize, skipPages, orderByStatement)) { _bDCustomerAccountWCF = new BDCustomerAccount(); _bDCustomerAccountWCF.CustomerAccountNumber = _bDCustomerAccount.CustomerAccountNumber; _bDCustomerAccountWCF.CustomerID = _bDCustomerAccount.CustomerID; _bDCustomerAccountWCF.SalesInvoiceId = _bDCustomerAccount.SalesInvoiceId; _bDCustomerAccountWCF.SalesDate = _bDCustomerAccount.SalesDate; _bDCustomerAccountWCF.InvoiceNumber = _bDCustomerAccount.InvoiceNumber; _bDCustomerAccountWCF.TotalPrice = _bDCustomerAccount.TotalPrice; _bDCustomerAccountWCF.PaidAmount = _bDCustomerAccount.PaidAmount; _bDCustomerAccountWCF.RemainingAmount = _bDCustomerAccount.RemainingAmount; _bDCustomerAccountWCF.IsVoid = _bDCustomerAccount.IsVoid; _bDCustomerAccountWCF.CreatedBy = _bDCustomerAccount.CreatedBy; _bDCustomerAccountWCF.CreateDate = _bDCustomerAccount.CreateDate; _bDCustomerAccountWCF.UpdatedBy = _bDCustomerAccount.UpdatedBy; _bDCustomerAccountWCF.UpdateDate = _bDCustomerAccount.UpdateDate; _bDCustomerAccountWCF.IsDeleted = _bDCustomerAccount.IsDeleted; _bDCustomerAccountWCF.DeletedBy = _bDCustomerAccount.DeletedBy; _bDCustomerAccountWCF.DeletedDate = _bDCustomerAccount.DeletedDate; _bDCustomerAccountWCF.Depit = _bDCustomerAccount.Depit; _bDCustomerAccountWCF.Credit = _bDCustomerAccount.Credit; _bDCustomerAccountWCF.ChequeNumber = _bDCustomerAccount.ChequeNumber; _bDCustomerAccountWCF.InvoiceType = _bDCustomerAccount.InvoiceType; _bDCustomerAccountWCF.LstDayToPay = _bDCustomerAccount.LstDayToPay; bDCustomerAccountCollection.Add(_bDCustomerAccountWCF); } return bDCustomerAccountCollection; }
/// <summary> /// This method will delete 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="SALSalesHeaderPrimaryKey">Primary Key information based on which data is to be deleted.</param> /// /// <returns>True if succeeded</returns> public bool DeleteAllByForeignKeySalesInvoiceId(SALSalesHeaderPrimaryKey pk) { return POS.DataLayer.BDCustomerAccountBase.DeleteAllByForeignKeySalesInvoiceId(new POS.DataLayer.SALSalesHeaderPrimaryKey(pk.SalesHeaderID)); }