Пример #1
0
 /// <summary>
 /// Takes the specified b u commitment request detail entity.
 /// </summary>
 /// <param name="bUCommitmentRequestDetailEntity">The b u commitment request detail entity.</param>
 /// <returns>System.Object[].</returns>
 private static object[] Take(OpeningCommitmentDetailEntity openingCommitmentDetailEntity)
 {
     return(new object[]
     {
         "@RefDetailID", openingCommitmentDetailEntity.RefDetailId,
         "@RefID", openingCommitmentDetailEntity.RefId,
         "@Description", openingCommitmentDetailEntity.Description,
         "@CurrencyID", openingCommitmentDetailEntity.CurrencyId,
         "@ExchangeRate", openingCommitmentDetailEntity.ExchangeRate,
         "@Amount", openingCommitmentDetailEntity.Amount,
         "@AmountOC", openingCommitmentDetailEntity.AmountOC,
         "@BudgetSourceID", openingCommitmentDetailEntity.BudgetSourceId,
         "@BudgetChapterCode", openingCommitmentDetailEntity.BudgetChapterCode,
         "@BudgetKindItemCode", openingCommitmentDetailEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", openingCommitmentDetailEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", openingCommitmentDetailEntity.BudgetItemCode,
         "@BudgetSubItemCode", openingCommitmentDetailEntity.BudgetSubItemCode,
         "@BudgetDetailItemCode", openingCommitmentDetailEntity.BudgetDetailItemCode,
         "@MethodDistributeID", openingCommitmentDetailEntity.MethodDistributeId,
         "@CashWithDrawTypeID", openingCommitmentDetailEntity.CashWithDrawTypeId,
         "@ActivityID", openingCommitmentDetailEntity.ActivityId,
         "@ProjectID", openingCommitmentDetailEntity.ProjectId,
         "@ProjectActivityID", openingCommitmentDetailEntity.ProjectActivityId,
         "@ProjectExpenseID", openingCommitmentDetailEntity.ProjectExpenseId,
         "@TaskID", openingCommitmentDetailEntity.TaskId,
         "@ListItemID", openingCommitmentDetailEntity.ListItemId,
         "@Approved", openingCommitmentDetailEntity.Approved,
         "@FundStructureID", openingCommitmentDetailEntity.FundStructureId,
         "@SortOrder", openingCommitmentDetailEntity.SortOrder,
         "@BankAccount", openingCommitmentDetailEntity.BankAccount,
         "@BudgetProvideCode", openingCommitmentDetailEntity.BudgetProvideCode,
     });
 }
Пример #2
0
        public List <OpeningCommitmentDetailEntity> OpeningCommitmentDetails(List <OpeningCommitmentDetail> details, string refid)
        {
            List <OpeningCommitmentDetailEntity> lstDetailEntities = new List <OpeningCommitmentDetailEntity>();

            foreach (var result in details)
            {
                var newresult = new OpeningCommitmentDetailEntity();
                newresult.RefDetailId           = result.RefDetailID.ToString();
                newresult.RefId                 = refid;
                newresult.Description           = result.Description;
                newresult.CurrencyId            = result.CurrencyID;
                newresult.ExchangeRate          = result.ExchangeRate;
                newresult.Amount                = result.Amount;
                newresult.AmountOC              = result.AmountOC;
                newresult.BudgetSourceId        = result.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.ActivityId            = result.ActivityID.ToString();
                newresult.ProjectId             = result.ProjectID.ToString();
                newresult.ProjectActivityId     = result.ProjectActivityID.ToString();
                newresult.ProjectExpenseId      = result.ProjectExpenseID.ToString();
                newresult.TaskId                = result.TaskID.ToString();
                newresult.ListItemId            = result.ListItemID.ToString();
                newresult.Approved              = result.Approved;
                newresult.FundStructureId       = result.FundStructureID.ToString();
                newresult.BankAccount           = result.BankAccount;
                newresult.SortOrder             = result.SortOrder;
                newresult.BudgetProvideCode     = result.BudgetProvidence == null ? null : result.BudgetProvidence.BudgetProvideCode;

                lstDetailEntities.Add(newresult);
            }
            return(lstDetailEntities);
        }
Пример #3
0
        /// <summary>
        /// Inserts the bu plan receipt detail.
        /// </summary>
        /// <param name="bUCommitmentRequestDetail">The b u commitment request detail.</param>
        /// <returns>System.String.</returns>
        public string InsertOpeningCommitmentDetail(OpeningCommitmentDetailEntity openingCommitmentDetail)
        {
            const string procedures = @"uspInsert_OpeningCommitmentDetail";

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