public List <BAWithDrawDetailEntity> BAWithDrawDetails(List <BAWithDrawDetail> details, string refid) { List <BAWithDrawDetailEntity> lstDetailEntities = new List <BAWithDrawDetailEntity>(); foreach (var result in details) { var newresult = new BAWithDrawDetailEntity(); 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.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.ProjectActivityId = result.Project1 == null ? null : result.Project1.ProjectID.ToString(); newresult.ListItemId = result.ListItem == null ? null : result.ListItem.ListItemID.ToString(); newresult.FundId = result.FundID.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.ProjectActivityEAId = result.Project2 == null ? null : result.Project2.ProjectID.ToString(); newresult.BudgetExpenseId = result.ProjectExpense1 == null ? null : result.ProjectExpense1.ProjectExpenseID.ToString(); //newresult.BankId = result.ban; lstDetailEntities.Add(newresult); } return(lstDetailEntities); }
/// <summary> /// Takes the specified bADeposit. /// </summary> /// <param name="bAWithDrawDetail">The bADeposit.</param> /// <returns></returns> private object[] Take(BAWithDrawDetailEntity bAWithDrawDetailEntity) { return(new object[] { "@RefDetailID", bAWithDrawDetailEntity.RefDetailId, "@RefID", bAWithDrawDetailEntity.RefId, "@Description", bAWithDrawDetailEntity.Description, "@DebitAccount", bAWithDrawDetailEntity.DebitAccount, "@CreditAccount", bAWithDrawDetailEntity.CreditAccount, "@Amount", bAWithDrawDetailEntity.Amount, "@AmountOC", bAWithDrawDetailEntity.AmountOC, "@BudgetSourceID", bAWithDrawDetailEntity.BudgetSourceId, "@BudgetChapterCode", bAWithDrawDetailEntity.BudgetChapterCode, "@BudgetKindItemCode", bAWithDrawDetailEntity.BudgetKindItemCode, "@BudgetSubKindItemCode", bAWithDrawDetailEntity.BudgetSubKindItemCode, "@BudgetItemCode", bAWithDrawDetailEntity.BudgetItemCode, "@BudgetSubItemCode", bAWithDrawDetailEntity.BudgetSubItemCode, "@MethodDistributeID", bAWithDrawDetailEntity.MethodDistributeId, "@CashWithDrawTypeID", bAWithDrawDetailEntity.CashWithDrawTypeId, "@AccountingObjectID", bAWithDrawDetailEntity.AccountingObjectId, "@ActivityID", bAWithDrawDetailEntity.ActivityId, "@ProjectID", bAWithDrawDetailEntity.ProjectId, "@ProjectActivityID", bAWithDrawDetailEntity.ProjectActivityId, "@FundID", bAWithDrawDetailEntity.FundId, "@ListItemID", bAWithDrawDetailEntity.ListItemId, "@SortOrder", bAWithDrawDetailEntity.SortOrder, "@BudgetDetailItemCode", bAWithDrawDetailEntity.BudgetDetailItemCode, "@OrgRefNo", bAWithDrawDetailEntity.OrgRefNo, "@OrgRefDate", bAWithDrawDetailEntity.OrgRefDate, "@FundStructureID", bAWithDrawDetailEntity.FundStructureId, "@ProjectActivityEAID", bAWithDrawDetailEntity.ProjectActivityEAId, "@BudgetExpenseID", bAWithDrawDetailEntity.BudgetExpenseId, "@BankID", bAWithDrawDetailEntity.BankId, "@ContractID", bAWithDrawDetailEntity.ContractId, "@CapitalPlanID", bAWithDrawDetailEntity.CapitalPlanId, "@AutoBusinessID", bAWithDrawDetailEntity.AutoBusinessId }); }
/// <summary> /// Inserts the bADeposit detail. /// </summary> /// <param name="bAWithDrawDetail">The bADeposit detail.</param> /// <returns></returns> public string InsertBAWithDrawDetailEntity(BAWithDrawDetailEntity bAWithDrawDetail) { const string sql = @"uspInsert_BAWithDrawDetail"; return(Db.Insert(sql, true, Take(bAWithDrawDetail))); }