Exemple #1
0
        public List <BABankTransferDetailParallelEntity> BABankTransferDetailParallels(List <BABankTransferDetailParallel> details, string refid)
        {
            List <BABankTransferDetailParallelEntity> lstDetailEntities = new List <BABankTransferDetailParallelEntity>();

            foreach (var result in details)
            {
                var newresult = new BABankTransferDetailParallelEntity();
                newresult.RefDetailId           = result.RefDetailID.ToString();
                newresult.ParentRefDetailId     = result.ParentRefDetailID.ToString();
                newresult.RefId                 = refid;
                newresult.Description           = result.Description;
                newresult.DebitAccount          = result.DebitAccount;
                newresult.CreditAccount         = result.CreditAccount;
                newresult.Amount                = result.Amount;
                newresult.AmountOC              = result.AmountOC;
                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.BudgetDetailItemCode  = result.BudgetDetailItemCode;
                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.Fund == null ? null : result.Fund.FundID.ToString();
                newresult.TaskId                = result.Task == null ? null : result.Task.TaskID.ToString();
                newresult.ListItemId            = result.ListItem == null ? null : result.ListItem.ListItemID.ToString();
                newresult.SortOrder             = result.SortOrder;
                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.BudgetProvideCode     = result.BudgetProvidence == null ? null : result.BudgetProvidence.BudgetProvideCode;
                newresult.TopicId               = result.Topic == null ? null : result.Topic.TopicID.ToString();
                newresult.BudgetExpenseId       = result.BudgetExpenseID.ToString();
                newresult.Approved              = result.Approved;
                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
 /// <summary>
 /// Takes the specified b a with draw detail parallel entity.
 /// </summary>
 /// <param name="bAWithDrawDetailParallelEntity">The b a with draw detail parallel entity.</param>
 /// <returns>System.Object[].</returns>
 private static object[] Take(BABankTransferDetailParallelEntity bAWithDrawDetailParallelEntity)
 {
     return(new object[]
     {
         "@RefDetailID", bAWithDrawDetailParallelEntity.RefDetailId,
         "@ParentRefDetailID", bAWithDrawDetailParallelEntity.ParentRefDetailId,
         "@RefID", bAWithDrawDetailParallelEntity.RefId,
         "@Description", bAWithDrawDetailParallelEntity.Description,
         "@DebitAccount", bAWithDrawDetailParallelEntity.DebitAccount,
         "@CreditAccount", bAWithDrawDetailParallelEntity.CreditAccount,
         "@Amount", bAWithDrawDetailParallelEntity.Amount,
         "@AmountOC", bAWithDrawDetailParallelEntity.AmountOC,
         "@BudgetSourceID", bAWithDrawDetailParallelEntity.BudgetSourceId,
         "@BudgetChapterCode", bAWithDrawDetailParallelEntity.BudgetChapterCode,
         "@BudgetKindItemCode", bAWithDrawDetailParallelEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", bAWithDrawDetailParallelEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", bAWithDrawDetailParallelEntity.BudgetItemCode,
         "@BudgetSubItemCode", bAWithDrawDetailParallelEntity.BudgetSubItemCode,
         "@BudgetDetailItemCode", bAWithDrawDetailParallelEntity.BudgetDetailItemCode,
         "@MethodDistributeID", bAWithDrawDetailParallelEntity.MethodDistributeId,
         "@CashWithdrawTypeID", bAWithDrawDetailParallelEntity.CashWithdrawTypeId,
         "@AccountingObjectID", bAWithDrawDetailParallelEntity.AccountingObjectId,
         "@ActivityID", bAWithDrawDetailParallelEntity.ActivityId,
         "@ProjectID", bAWithDrawDetailParallelEntity.ProjectId,
         "@FundID", bAWithDrawDetailParallelEntity.FundId,
         "@TaskID", bAWithDrawDetailParallelEntity.TaskId,
         "@ListItemID", bAWithDrawDetailParallelEntity.ListItemId,
         "@SortOrder", bAWithDrawDetailParallelEntity.SortOrder,
         "@OrgRefNo", bAWithDrawDetailParallelEntity.OrgRefNo,
         "@OrgRefDate", bAWithDrawDetailParallelEntity.OrgRefDate,
         "@FundStructureID", bAWithDrawDetailParallelEntity.FundStructureId,
         "@BankID", bAWithDrawDetailParallelEntity.BankId,
         "@BudgetProvideCode", bAWithDrawDetailParallelEntity.BudgetProvideCode,
         "@TopicID", bAWithDrawDetailParallelEntity.TopicId,
         "@BudgetExpenseID", bAWithDrawDetailParallelEntity.BudgetExpenseId,
         "@Approved", bAWithDrawDetailParallelEntity.Approved,
     });
 }
        /// <summary>
        /// Updates the ba bank transfer detail parallel.
        /// </summary>
        /// <param name="bankTransferDetail">The bank transfer detail.</param>
        /// <returns>System.String.</returns>
        public string UpdateBABankTransferDetailParallel(BABankTransferDetailParallelEntity bankTransferDetail)
        {
            const string procedures = @"uspUpdate_BABankTransferDetailParallel";

            return(Db.Update(procedures, true, Take(bankTransferDetail)));
        }
        /// <summary>
        /// Inserts the ba bank transfer detail parallel.
        /// </summary>
        /// <param name="bankTransferDetail">The bank transfer detail.</param>
        /// <returns>System.String.</returns>
        public string InsertBABankTransferDetailParallel(BABankTransferDetailParallelEntity bankTransferDetail)
        {
            const string procedures = @"uspInsert_BABankTransferDetailParallel";

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