/// <summary>
 ///     Takes the specified bADeposit.
 /// </summary>
 /// <param name="bADepositDetailFixedAsset">The bADeposit.</param>
 /// <returns></returns>
 private static object[] Take(BADepositDetailFixedAssetEntity bADepositDetailFixedAssetEntity)
 {
     return(new object[]
     {
         "@RefDetailID", bADepositDetailFixedAssetEntity.RefDetailId,
         "@RefID", bADepositDetailFixedAssetEntity.RefId,
         "@FixedAssetID", bADepositDetailFixedAssetEntity.FixedAssetId,
         "@Description", bADepositDetailFixedAssetEntity.Description,
         "@DebitAccount", bADepositDetailFixedAssetEntity.DebitAccount,
         "@CreditAccount", bADepositDetailFixedAssetEntity.CreditAccount,
         "@Amount", bADepositDetailFixedAssetEntity.Amount,
         "@TaxRate", bADepositDetailFixedAssetEntity.TaxRate,
         "@TaxAmount", bADepositDetailFixedAssetEntity.TaxAmount,
         "@TaxAccount", bADepositDetailFixedAssetEntity.TaxAccount,
         "@BudgetSourceID", bADepositDetailFixedAssetEntity.BudgetSourceId,
         "@BudgetChapterCode", bADepositDetailFixedAssetEntity.BudgetChapterCode,
         "@BudgetKindItemCode", bADepositDetailFixedAssetEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", bADepositDetailFixedAssetEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", bADepositDetailFixedAssetEntity.BudgetItemCode,
         "@BudgetSubItemCode", bADepositDetailFixedAssetEntity.BudgetSubItemCode,
         "@MethodDistributeID", bADepositDetailFixedAssetEntity.MethodDistributeId,
         "@CashWithdrawTypeID", bADepositDetailFixedAssetEntity.CashWithdrawTypeId,
         "@AccountingObjectID", bADepositDetailFixedAssetEntity.AccountingObjectId,
         "@ActivityID", bADepositDetailFixedAssetEntity.ActivityId,
         "@ProjectID", bADepositDetailFixedAssetEntity.ProjectId,
         "@ProjectActivityID", bADepositDetailFixedAssetEntity.ProjectActivityId,
         "@ProjectExpenseID", bADepositDetailFixedAssetEntity.ProjectExpenseId,
         "@ListItemID", bADepositDetailFixedAssetEntity.ListItemId,
         "@SortOrder", bADepositDetailFixedAssetEntity.SortOrder,
         "@BudgetDetailItemCode", bADepositDetailFixedAssetEntity.BudgetDetailItemCode,
         "@FundStructureID", bADepositDetailFixedAssetEntity.FundStructureId,
         "@ProjectExpenseEAID", bADepositDetailFixedAssetEntity.ProjectExpenseEAId,
         "@ProjectActivityEAID", bADepositDetailFixedAssetEntity.ProjectActivityEAId
     });
 }
        public List <BADepositDetailFixedAssetEntity> BADepositDetailFixedAssets(List <BADepositDetailFixedAsset> details, string refid)
        {
            List <BADepositDetailFixedAssetEntity> lstDetailEntities = new List <BADepositDetailFixedAssetEntity>();

            foreach (var result in details)
            {
                var newresult = new BADepositDetailFixedAssetEntity();
                newresult.RefDetailId           = result.RefDetailID.ToString();
                newresult.RefId                 = refid;
                newresult.FixedAssetId          = result.FixedAsset == null ? null : result.FixedAsset.FixedAssetID.ToString();
                newresult.Description           = result.Description;
                newresult.DebitAccount          = result.DebitAccount;
                newresult.CreditAccount         = result.CreditAccount;
                newresult.Amount                = result.Amount;
                newresult.TaxRate               = result.TaxRate ?? 0;
                newresult.TaxAmount             = result.TaxAmount;
                newresult.TaxAccount            = result.TaxAccount;
                newresult.BudgetSourceId        = result.BudgetSource == null ? null : result.BudgetSource.BudgetSourceID.ToString();
                newresult.BudgetChapterCode     = result.BudgetChapterCode;
                newresult.BudgetKindItemCode    = result.BudgetKindItemCode;
                newresult.BudgetSubKindItemCode = result.BudgetSubKindItemCode;
                newresult.BudgetItemCode        = result.BudgetItemCode;
                newresult.BudgetSubItemCode     = result.BudgetSubItemCode;
                newresult.MethodDistributeId    = result.MethodDistributeID;
                newresult.CashWithdrawTypeId    = ConvertCash.ConvertCash(result.CashWithdrawTypeID);
                newresult.AccountingObjectId    = result.AccountingObject == null ? null : result.AccountingObject.AccountingObjectID.ToString();
                newresult.ActivityId            = result.Activity == null ? null : result.Activity.ActivityID.ToString();
                newresult.ProjectId             = result.Project == null ? null : result.Project.ProjectID.ToString();
                newresult.ProjectActivityId     = result.Project1 == null?null: result.Project1.ProjectID.ToString();
                newresult.ProjectExpenseId      = result.ProjectExpense == null ? null : result.ProjectExpense.ProjectExpenseID.ToString();
                newresult.ListItemId            = result.ListItem == null ? null : result.ListItem.ListItemID.ToString();
                newresult.SortOrder             = result.SortOrder;
                newresult.BudgetDetailItemCode  = result.BudgetDetailItemCode;
                newresult.FundStructureId       = result.FundStructure == null ? null : result.FundStructure.FundStructureID.ToString();
                newresult.ProjectExpenseEAId    = result.ProjectExpense1 == null ? null : result.ProjectExpense1.ProjectExpenseID.ToString();
                newresult.ProjectActivityEAId   = result.Project1 == null ? null : result.Project1.ProjectID.ToString();
                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
        /// <summary>
        ///     Inserts the bADeposit detail.
        /// </summary>
        /// <param name="bADepositDetailFixedAsset">The bADeposit detail.</param>
        /// <returns></returns>
        public string InsertBADepositDetailFixedAsset(BADepositDetailFixedAssetEntity bADepositDetailFixedAsset)
        {
            const string sql = @"uspInsert_BADepositDetailFixedAsset";

            return(Db.Insert(sql, true, Take(bADepositDetailFixedAsset)));
        }