/// <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 return a list of objects representing all records in the table. /// </summary> /// /// <returns>list of objects of class BDCustomerAccount in the form of object of BDCustomerAccountCollection </returns> public BDCustomerAccountCollection SelectAll() { BDCustomerAccountCollection bDCustomerAccountCollection = new BDCustomerAccountCollection(); foreach (POS.DataLayer.BDCustomerAccount _bDCustomerAccount in POS.DataLayer.BDCustomerAccountBase.SelectAll()) { _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 update one new row into the database using the property Information /// </summary> /// /// <param name="bDCustomerAccount" type="BDCustomerAccount">This BDCustomerAccount will be updated in the database.</param> /// /// <returns>True if succeeded</returns> public bool Update(BDCustomerAccount bDCustomerAccount) { _bDCustomerAccount=POS.DataLayer.BDCustomerAccount.SelectOne(new POS.DataLayer.BDCustomerAccountPrimaryKey(bDCustomerAccount.CustomerAccountNumber)); _bDCustomerAccount.CustomerID=bDCustomerAccount.CustomerID; _bDCustomerAccount.SalesInvoiceId=bDCustomerAccount.SalesInvoiceId; _bDCustomerAccount.SalesDate=bDCustomerAccount.SalesDate; _bDCustomerAccount.InvoiceNumber=bDCustomerAccount.InvoiceNumber; _bDCustomerAccount.TotalPrice=bDCustomerAccount.TotalPrice; _bDCustomerAccount.PaidAmount=bDCustomerAccount.PaidAmount; _bDCustomerAccount.RemainingAmount=bDCustomerAccount.RemainingAmount; _bDCustomerAccount.IsVoid=bDCustomerAccount.IsVoid; _bDCustomerAccount.CreatedBy=bDCustomerAccount.CreatedBy; _bDCustomerAccount.CreateDate=bDCustomerAccount.CreateDate; _bDCustomerAccount.UpdatedBy=bDCustomerAccount.UpdatedBy; _bDCustomerAccount.UpdateDate=bDCustomerAccount.UpdateDate; _bDCustomerAccount.IsDeleted=bDCustomerAccount.IsDeleted; _bDCustomerAccount.DeletedBy=bDCustomerAccount.DeletedBy; _bDCustomerAccount.DeletedDate=bDCustomerAccount.DeletedDate; _bDCustomerAccount.Depit=bDCustomerAccount.Depit; _bDCustomerAccount.Credit=bDCustomerAccount.Credit; _bDCustomerAccount.ChequeNumber=bDCustomerAccount.ChequeNumber; _bDCustomerAccount.InvoiceType=bDCustomerAccount.InvoiceType; _bDCustomerAccount.LstDayToPay=bDCustomerAccount.LstDayToPay; return _bDCustomerAccount.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 BDCustomerAccount</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 BDCustomerAccount in the form of an object of class BDCustomerAccountCollection</returns> public BDCustomerAccountCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement) { BDCustomerAccountCollection bDCustomerAccountCollection = new BDCustomerAccountCollection(); foreach (POS.DataLayer.BDCustomerAccount _bDCustomerAccount in POS.DataLayer.BDCustomerAccountBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, 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 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; }