Пример #1
0
        public List <CAPaymentDetailParallelEntity> CAPaymentDetailParallels(List <CAPaymentDetailParallel> details, string refid)
        {
            List <CAPaymentDetailParallelEntity> lstDetailEntities = new List <CAPaymentDetailParallelEntity>();

            foreach (var result in details)
            {
                var newresult = new CAPaymentDetailParallelEntity();
                newresult.RefDetailId           = result.RefDetailID.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.TaskId                = result.Task == null ? null : result.Task.TaskID.ToString();
                newresult.ListItemId            = result.ListItem == null ? null : result.ListItem.ListItemID.ToString();
                newresult.Approved              = result.Approved;
                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.BudgetExpenseId       = result.BudgetExpenseID.ToString();
                newresult.BudgetProvideCode     = result.BudgetProvidence == null ? null : result.BudgetProvidence.BudgetProvideCode;

                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
 /// <summary>
 /// Takes the specified c a payment detail parallel entity.
 /// </summary>
 /// <param name="cAPaymentDetailParallelEntity">The c a payment detail parallel entity.</param>
 /// <returns>System.Object[].</returns>
 private static object[] Take(CAPaymentDetailParallelEntity cAPaymentDetailParallelEntity)
 {
     return(new object[]
     {
         "@RefDetailID", cAPaymentDetailParallelEntity.RefDetailId,
         "@RefID", cAPaymentDetailParallelEntity.RefId,
         "@Description", cAPaymentDetailParallelEntity.Description,
         "@DebitAccount", cAPaymentDetailParallelEntity.DebitAccount,
         "@CreditAccount", cAPaymentDetailParallelEntity.CreditAccount,
         "@Amount", cAPaymentDetailParallelEntity.Amount,
         "@AmountOC", cAPaymentDetailParallelEntity.AmountOC,
         "@BudgetSourceID", cAPaymentDetailParallelEntity.BudgetSourceId,
         "@BudgetChapterCode", cAPaymentDetailParallelEntity.BudgetChapterCode,
         "@BudgetKindItemCode", cAPaymentDetailParallelEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", cAPaymentDetailParallelEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", cAPaymentDetailParallelEntity.BudgetItemCode,
         "@BudgetSubItemCode", cAPaymentDetailParallelEntity.BudgetSubItemCode,
         "@BudgetDetailItemCode", cAPaymentDetailParallelEntity.BudgetDetailItemCode,
         "@MethodDistributeID", cAPaymentDetailParallelEntity.MethodDistributeId,
         "@CashWithdrawTypeID", cAPaymentDetailParallelEntity.CashWithdrawTypeId,
         "@AccountingObjectID", cAPaymentDetailParallelEntity.AccountingObjectId,
         "@ActivityID", cAPaymentDetailParallelEntity.ActivityId,
         "@ProjectID", cAPaymentDetailParallelEntity.ProjectId,
         "@TaskID", cAPaymentDetailParallelEntity.TaskId,
         "@ListItemID", cAPaymentDetailParallelEntity.ListItemId,
         "@Approved", cAPaymentDetailParallelEntity.Approved,
         "@SortOrder", cAPaymentDetailParallelEntity.SortOrder,
         "@OrgRefNo", cAPaymentDetailParallelEntity.OrgRefNo,
         "@OrgRefDate", cAPaymentDetailParallelEntity.OrgRefDate,
         "@FundStructureID", cAPaymentDetailParallelEntity.FundStructureId,
         "@BankID", cAPaymentDetailParallelEntity.BankId,
         "@BudgetExpenseID", cAPaymentDetailParallelEntity.BudgetExpenseId,
         "@BudgetProvideCode", cAPaymentDetailParallelEntity.BudgetProvideCode,
         "@ContractID", cAPaymentDetailParallelEntity.ContractId,
         "@CapitalPlanID", cAPaymentDetailParallelEntity.CapitalPlanId,
         "@Quantity", cAPaymentDetailParallelEntity.Quantity,
         "@UnitPrice", cAPaymentDetailParallelEntity.UnitPrice,
         "@FixedAssetId", cAPaymentDetailParallelEntity.FixedAssetId,
     });
 }
        /// <summary>
        /// Updates the ca payment detail parallel.
        /// </summary>
        /// <param name="caPaymentDetail">The ca payment detail.</param>
        /// <returns>System.String.</returns>
        public string UpdateCAPaymentDetailParallel(CAPaymentDetailParallelEntity caPaymentDetail)
        {
            const string procedures = @"uspUpdate_CAPaymentDetailParallel";

            return(Db.Update(procedures, true, Take(caPaymentDetail)));
        }
        /// <summary>
        /// Inserts the ca payment detail parallel.
        /// </summary>
        /// <param name="caPaymentDetail">The ca payment detail.</param>
        /// <returns>System.String.</returns>
        public string InsertCAPaymentDetailParallel(CAPaymentDetailParallelEntity caPaymentDetail)
        {
            const string procedures = @"uspInsert_CAPaymentDetailParallel";

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