/// <summary>
        ///     Inserts the bADeposit detail.
        /// </summary>
        /// <param name="bAWithDrawDetailFixedAsset">The bADeposit detail.</param>
        /// <returns></returns>
        public string InsertBAWithDrawDetailFixedAssetEntity(
            BAWithDrawDetailFixedAssetEntity bAWithDrawDetailFixedAsset)
        {
            const string sql = @"uspInsert_BAWithDrawDetailFixedAsset";

            return(Db.Insert(sql, true, Take(bAWithDrawDetailFixedAsset)));
        }
Exemple #2
0
        public List <BAWithDrawDetailFixedAssetEntity> BAWithDrawDetailFixedAssets(List <BAWithDrawDetailFixedAsset> details, string refid)
        {
            List <BAWithDrawDetailFixedAssetEntity> lstDetailEntities = new List <BAWithDrawDetailFixedAssetEntity>();

            foreach (var result in details)
            {
                var newresult = new BAWithDrawDetailFixedAssetEntity();
                newresult.RefDetailId           = result.RefDetailID.ToString();
                newresult.RefId                 = refid;
                newresult.FixedAssetId          = result.FixedAsset == null ? null : result.FixedAsset.FixedAssetID.ToString();
                newresult.Description           = result.Description;
                newresult.DepartmentId          = result.Department == null ? null : result.Department.DepartmentID.ToString();
                newresult.DebitAccount          = result.DebitAccount;
                newresult.CreditAccount         = result.CreditAccount;
                newresult.Amount                = result.Amount;
                newresult.TaxRate               = result.TaxRate;
                newresult.TaxAmount             = result.TaxAmount;
                newresult.TaxAccount            = result.TaxAccount;
                newresult.InvType               = result.InvType;
                newresult.InvDate               = result.InvDate;
                newresult.InvSeries             = result.InvSeries;
                newresult.InvNo                 = result.InvNo;
                newresult.PurchasePurposeId     = result.PurchasePurpose == null ? null : result.PurchasePurpose.PurchasePurposeID.ToString();
                newresult.FreightAmount         = result.FreightAmount;
                newresult.OrgPrice              = result.OrgPrice;
                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.FundId                = result.FundID.ToString();
                newresult.ProjectActivityId     = result.Project1 == null ? null : result.Project1.ProjectID.ToString();
                newresult.ListItemId            = result.ListItem == null ? null : result.ListItem.ListItemID.ToString();
                newresult.SortOrder             = result.SortOrder;
                newresult.BudgetDetailItemCode  = result.BudgetDetailItemCode;
                newresult.InvoiceTypeCode       = result.InvoiceTypeCode;
                newresult.OrgRefNo              = result.OrgRefNo;
                newresult.OrgRefDate            = result.OrgRefDate;
                newresult.FundStructureId       = result.FundStructure == null ? null : result.FundStructure.FundStructureID.ToString();
                newresult.BankId                = result.BankAccount == null ? null : banks.FirstOrDefault(x => x.BankAccount == result.BankAccount).BankInfoID.ToString();
                newresult.ProjectActivityEAId   = result.Project2 == null ? null : result.Project2.ProjectID.ToString();
                //newresult.BudgetExpenseId = result.budgete;

                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
 /// <summary>
 ///     Takes the specified bADeposit.
 /// </summary>
 /// <param name="bAWithDrawDetailFixedAssetEntity">The b a with draw detail fixed asset entity.</param>
 /// <returns></returns>
 private object[] Take(BAWithDrawDetailFixedAssetEntity bAWithDrawDetailFixedAssetEntity)
 {
     return(new object[]
     {
         "@RefDetailID", bAWithDrawDetailFixedAssetEntity.RefDetailId,
         "@RefID", bAWithDrawDetailFixedAssetEntity.RefId,
         "@FixedAssetID", bAWithDrawDetailFixedAssetEntity.FixedAssetId,
         "@Description", bAWithDrawDetailFixedAssetEntity.Description,
         "@DepartmentID", bAWithDrawDetailFixedAssetEntity.DepartmentId,
         "@DebitAccount", bAWithDrawDetailFixedAssetEntity.DebitAccount,
         "@CreditAccount", bAWithDrawDetailFixedAssetEntity.CreditAccount,
         "@Amount", bAWithDrawDetailFixedAssetEntity.Amount,
         "@TaxRate", bAWithDrawDetailFixedAssetEntity.TaxRate,
         "@TaxAmount", bAWithDrawDetailFixedAssetEntity.TaxAmount,
         "@TaxAccount", bAWithDrawDetailFixedAssetEntity.TaxAccount,
         "@InvType", bAWithDrawDetailFixedAssetEntity.InvType,
         "@InvDate", bAWithDrawDetailFixedAssetEntity.InvDate,
         "@InvSeries", bAWithDrawDetailFixedAssetEntity.InvSeries,
         "@InvNo", bAWithDrawDetailFixedAssetEntity.InvNo,
         "@PurchasePurposeID", bAWithDrawDetailFixedAssetEntity.PurchasePurposeId,
         "@FreightAmount", bAWithDrawDetailFixedAssetEntity.FreightAmount,
         "@OrgPrice", bAWithDrawDetailFixedAssetEntity.OrgPrice,
         "@BudgetSourceID", bAWithDrawDetailFixedAssetEntity.BudgetSourceId,
         "@BudgetChapterCode", bAWithDrawDetailFixedAssetEntity.BudgetChapterCode,
         "@BudgetKindItemCode", bAWithDrawDetailFixedAssetEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", bAWithDrawDetailFixedAssetEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", bAWithDrawDetailFixedAssetEntity.BudgetItemCode,
         "@BudgetSubItemCode", bAWithDrawDetailFixedAssetEntity.BudgetSubItemCode,
         "@MethodDistributeID", bAWithDrawDetailFixedAssetEntity.MethodDistributeId,
         "@CashWithdrawTypeID", bAWithDrawDetailFixedAssetEntity.CashWithdrawTypeId,
         "@AccountingObjectID", bAWithDrawDetailFixedAssetEntity.AccountingObjectId,
         "@ActivityID", bAWithDrawDetailFixedAssetEntity.ActivityId,
         "@ProjectID", bAWithDrawDetailFixedAssetEntity.ProjectId,
         "@ProjectActivityID", bAWithDrawDetailFixedAssetEntity.ProjectActivityId,
         "@FundID", bAWithDrawDetailFixedAssetEntity.FundId,
         "@ListItemID", bAWithDrawDetailFixedAssetEntity.ListItemId,
         "@SortOrder", bAWithDrawDetailFixedAssetEntity.SortOrder,
         "@BudgetDetailItemCode", bAWithDrawDetailFixedAssetEntity.BudgetDetailItemCode,
         "@InvoiceTypeCode", bAWithDrawDetailFixedAssetEntity.InvoiceTypeCode,
         "@OrgRefNo", bAWithDrawDetailFixedAssetEntity.OrgRefNo,
         "@OrgRefDate", bAWithDrawDetailFixedAssetEntity.OrgRefDate,
         "@FundStructureID", bAWithDrawDetailFixedAssetEntity.FundStructureId,
         "@BankID", bAWithDrawDetailFixedAssetEntity.BankId,
         "@ProjectActivityEAID", bAWithDrawDetailFixedAssetEntity.ProjectActivityEAId,
         "@BudgetExpenseID", bAWithDrawDetailFixedAssetEntity.BudgetExpenseId,
     });
 }