public List <GLVoucherDetailParallelEntity> GLVoucherDetailParallelFromBATransfers(List <BATransferDetailParallel> details, string refid) { List <GLVoucherDetailParallelEntity> lstDetailEntities = new List <GLVoucherDetailParallelEntity>(); foreach (var result in details) { var newresult = new GLVoucherDetailParallelEntity(); 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 c a payment detail parallel entity. /// </summary> /// <param name="bAWithDrawDetailParallelEntity">The b a with draw detail parallel entity.</param> /// <returns>System.Object[].</returns> private static object[] Take(GLVoucherDetailParallelEntity 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, "@ContractID", bAWithDrawDetailParallelEntity.ContractId, "@CapitalPlanID", bAWithDrawDetailParallelEntity.CapitalPlanId, }); }
/// <summary> /// Updates the gl voucher detail parallel. /// </summary> /// <param name="withDrawDetail">The with draw detail.</param> /// <returns>System.String.</returns> public string UpdateGLVoucherDetailParallel(GLVoucherDetailParallelEntity withDrawDetail) { const string procedures = @"uspUpdate_GLVoucherDetailParallel"; return(Db.Update(procedures, true, Take(withDrawDetail))); }
/// <summary> /// Inserts the gl voucher detail parallel. /// </summary> /// <param name="withDrawDetail">The with draw detail.</param> /// <returns>System.String.</returns> public string InsertGLVoucherDetailParallel(GLVoucherDetailParallelEntity withDrawDetail) { const string procedures = @"uspInsert_GLVoucherDetailParallel"; return(Db.Insert(procedures, true, Take(withDrawDetail))); }