/// <summary> /// This method will return an object representing the record matching the primary key information specified. /// </summary> /// /// <param name="pk" type="BDCustomerAccountPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class BDCustomerAccount</returns> public BDCustomerAccount SelectOne(BDCustomerAccountPrimaryKey pk) { _bDCustomerAccountWCF = new BDCustomerAccount(); _bDCustomerAccount = POS.DataLayer.BDCustomerAccountBase.SelectOne(new POS.DataLayer.BDCustomerAccountPrimaryKey(pk.CustomerAccountNumber)); _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; return _bDCustomerAccountWCF; }
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="BDCustomerAccountPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// <returns>True if succeeded</returns> public bool Delete(BDCustomerAccountPrimaryKey pk) { return POS.DataLayer.BDCustomerAccountBase.Delete(new POS.DataLayer.BDCustomerAccountPrimaryKey(pk.CustomerAccountNumber)); }