/// <summary>
 /// Takes the specified information.
 /// </summary>
 /// <param name="bUPlanWithdrawDetailEntity">The b u plan withdraw detail entity.</param>
 /// <returns>System.Object[].</returns>
 private object[] Take(BUPlanWithdrawDetailEntity bUPlanWithdrawDetailEntity)
 {
     return(new object[]
     {
         "@RefDetailID", bUPlanWithdrawDetailEntity.RefDetailId,
         "@RefID", bUPlanWithdrawDetailEntity.RefId,
         "@Description", bUPlanWithdrawDetailEntity.Description,
         "@BudgetSourceID", bUPlanWithdrawDetailEntity.BudgetSourceId,
         "@BudgetChapterCode", bUPlanWithdrawDetailEntity.BudgetChapterCode,
         "@BudgetKindItemCode", bUPlanWithdrawDetailEntity.BudgetKindItemCode,
         "@BudgetSubKindItemCode", bUPlanWithdrawDetailEntity.BudgetSubKindItemCode,
         "@BudgetItemCode", bUPlanWithdrawDetailEntity.BudgetItemCode,
         "@BudgetSubItemCode", bUPlanWithdrawDetailEntity.BudgetSubItemCode,
         "@CreditAccount", bUPlanWithdrawDetailEntity.CreditAccount,
         "@Amount", bUPlanWithdrawDetailEntity.Amount,
         "@AmountOC", bUPlanWithdrawDetailEntity.AmountOC,
         "@ProjectID", bUPlanWithdrawDetailEntity.ProjectId,
         "@ListItemID", bUPlanWithdrawDetailEntity.ListItemId,
         "@SortOrder", bUPlanWithdrawDetailEntity.SortOrder,
         "@BudgetDetailItemCode", bUPlanWithdrawDetailEntity.BudgetDetailItemCode,
         "@OrgRefNo", bUPlanWithdrawDetailEntity.OrgRefNo,
         "@OrgRefDate", bUPlanWithdrawDetailEntity.OrgRefDate,
         "@FundStructureID", bUPlanWithdrawDetailEntity.FundStructureId,
         "@BankID", bUPlanWithdrawDetailEntity.BankId,
         "@ProjectActivityEAID", bUPlanWithdrawDetailEntity.ProjectActivityEAId,
         "@BudgetProvideCode", bUPlanWithdrawDetailEntity.BudgetProvideCode,
         "@BudgetExpenseID", bUPlanWithdrawDetailEntity.BudgetExpenseId
     });
 }
Beispiel #2
0
        public List <BUPlanWithdrawDetailEntity> BuPlanWithDrawDetails(List <BUPlanWithdrawDetail> details, string refid)
        {
            List <BUPlanWithdrawDetailEntity> lstBuPlanReceiptDetailEntities = new List <BUPlanWithdrawDetailEntity>();

            foreach (var result in details)
            {
                var newresult = new BUPlanWithdrawDetailEntity();
                newresult.RefDetailId           = result.RefDetailID.ToString();
                newresult.RefId                 = refid;
                newresult.Description           = result.Description;
                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.CreditAccount         = result.CreditAccount;
                newresult.Amount                = result.Amount;
                newresult.AmountOC              = result.AmountOC;
                newresult.ProjectId             = result.Project == null ? null : result.Project.ProjectID.ToString();
                newresult.ListItemId            = result.ListItem == null ? null : result.ListItem.ListItemID.ToString();
                newresult.SortOrder             = result.SortOrder;
                newresult.BudgetDetailItemCode  = result.BudgetDetailItemCode;
                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.Project1 == null ? null : result.Project1.ProjectID.ToString();
                newresult.BudgetProvideCode     = result.BudgetProvidence == null ? null : result.BudgetProvidence.BudgetProvideCode;
                //newresult.BudgetExpenseId = result.buget
                lstBuPlanReceiptDetailEntities.Add(newresult);
            }
            return(lstBuPlanReceiptDetailEntities);
        }
        /// <summary>
        /// Inserts the bu plan withdraw detail.
        /// </summary>
        /// <param name="planWithdrawDetailEntity">The plan withdraw detail entity.</param>
        /// <returns>System.String.</returns>
        public string InsertBUPlanWithdrawDetail(BUPlanWithdrawDetailEntity planWithdrawDetailEntity)
        {
            const string procedures = @"uspInsert_BUPlanWithdrawDetail";

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