public List <CAReceiptDetailTaxEntity> CAReceiptDetailTaxes(List <CAReceiptDetailTax> details, string refid)
        {
            List <CAReceiptDetailTaxEntity> lstDetailEntities = new List <CAReceiptDetailTaxEntity>();

            foreach (var result in details)
            {
                var newresult = new CAReceiptDetailTaxEntity();
                newresult.RefDetailId        = result.RefDetailID.ToString();
                newresult.RefId              = refid;
                newresult.Description        = result.Description;
                newresult.VATAmount          = result.VATAmount;
                newresult.VATRate            = result.VATRate;
                newresult.TurnOver           = result.TurnOver;
                newresult.InvType            = result.InvType;
                newresult.InvDate            = result.InvDate;
                newresult.InvSeries          = result.InvSeries;
                newresult.InvNo              = result.InvNo;
                newresult.PurchasePurposeId  = result.PurchasePurposeID.ToString();
                newresult.AccountingObjectId = result.AccountingObjectID.ToString();
                newresult.CompanyTaxCode     = result.CompanyTaxCode;
                newresult.SortOrder          = result.SortOrder;
                newresult.InvoiceTypeCode    = result.InvoiceTypeCode;
                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
 /// <summary>
 /// Takes the specified information.
 /// </summary>
 /// <param name="cAReceiptDetailTaxEntity">The c a receipt detail tax entity.</param>
 /// <returns>System.Object[].</returns>
 private object[] Take(CAReceiptDetailTaxEntity cAReceiptDetailTaxEntity)
 {
     return(new object[]
     {
         "@RefDetailId", cAReceiptDetailTaxEntity.RefDetailId,
         "@RefId", cAReceiptDetailTaxEntity.RefId,
         "@Description", cAReceiptDetailTaxEntity.Description,
         "@VATAmount", cAReceiptDetailTaxEntity.VATAmount,
         "@VATRate", cAReceiptDetailTaxEntity.VATRate,
         "@TurnOver", cAReceiptDetailTaxEntity.TurnOver,
         "@InvType", cAReceiptDetailTaxEntity.InvType,
         "@InvDate", cAReceiptDetailTaxEntity.InvDate,
         "@InvSeries", cAReceiptDetailTaxEntity.InvSeries,
         "@InvNo", cAReceiptDetailTaxEntity.InvNo,
         "@PurchasePurposeId", cAReceiptDetailTaxEntity.PurchasePurposeId,
         "@AccountingObjectId", cAReceiptDetailTaxEntity.AccountingObjectId,
         "@CompanyTaxCode", cAReceiptDetailTaxEntity.CompanyTaxCode,
         "@SortOrder", cAReceiptDetailTaxEntity.SortOrder,
         "@InvoiceTypeCode", cAReceiptDetailTaxEntity.InvoiceTypeCode
     });
 }
        /// <summary>
        /// Inserts the ca receipt detail.
        /// </summary>
        /// <param name="receiptDetailEntity">The receipt detail entity.</param>
        /// <returns>System.String.</returns>
        public string InsertCAReceiptDetailTax(CAReceiptDetailTaxEntity receiptDetailEntity)
        {
            const string procedures = @"uspInsert_CAReceiptDetailTax";

            return(Db.Insert(procedures, true, Take(receiptDetailEntity)));
        }