/// <summary> /// Deletes the ca payment. /// </summary> /// <param name="glVoucher">The ca payment.</param> /// <returns></returns> /// <exception cref="System.NotImplementedException"></exception> public string DeleteGLVoucher(GLVoucherEntity glVoucher) { const string sql = @"uspDelete_GlVoucher"; object[] parms = { "@RefID", glVoucher.RefId }; return(Db.Delete(sql, true, parms)); }
/// <summary> /// Takes the specified f a depreciation entity. /// </summary> /// <param name="glVoucherEntity">The gl voucher entity.</param> /// <returns></returns> private object[] Take(GLVoucherEntity glVoucherEntity) { return(new object[] { "@RefID", glVoucherEntity.RefId, "@RefType", glVoucherEntity.RefType, "@RefDate", glVoucherEntity.RefDate, "@PostedDate", glVoucherEntity.PostedDate, "@RefNo", glVoucherEntity.RefNo, "@CurrencyCode", glVoucherEntity.CurrencyCode, "@ExchangeRate", glVoucherEntity.ExchangeRate, "@ParalellRefNo", glVoucherEntity.ParalellRefNo, "@JournalMemo", glVoucherEntity.JournalMemo, "@TotalAmount", glVoucherEntity.TotalAmount, "@TotalAmountOC", glVoucherEntity.TotalAmountOC, "@ParentRefID", glVoucherEntity.ParentRefId, "@Posted", glVoucherEntity.Posted, "@PostVersion", glVoucherEntity.PostVersion, "@EditVersion", glVoucherEntity.EditVersion, "@AdvancePaymentOrder", glVoucherEntity.AdvancePaymentOrder, "@BUTransferRefID", glVoucherEntity.BUTransferRefId, "@BUTransferType", glVoucherEntity.BUTransferType, "@AccountingObjectID", glVoucherEntity.AccountingObjectId }); }
/// <summary> /// Updates the ca payment. /// </summary> /// <param name="glVoucher">The ca payment.</param> /// <returns></returns> /// <exception cref="System.NotImplementedException"></exception> public string UpdateGLVoucher(GLVoucherEntity glVoucher) { const string sql = @"uspUpdate_GLVoucher"; return(Db.Update(sql, true, Take(glVoucher))); }
/// <summary> /// Inserts the ca payment. /// </summary> /// <param name="glVoucher">The ca payment.</param> /// <returns></returns> /// <exception cref="System.NotImplementedException"></exception> public string InsertGLVoucher(GLVoucherEntity glVoucher) { const string sql = @"uspInsert_GLVoucher"; return(Db.Insert(sql, true, Take(glVoucher))); }
public List <GLVoucherEntity> GetGLVouchers(string connectionString) { List <GLVoucherEntity> buentity = new List <GLVoucherEntity>(); using (var context = new MISAEntity(connectionString)) { var querry = context.GLVoucherDetails.ToList(); var projects = context.Projects.ToList(); var currencys = context.CCies.ToList(); var budgetsource = context.BudgetSources.ToList(); var listitems = context.ListItems.ToList(); var funds = context.Funds.ToList(); var fundstructures = context.FundStructures.ToList(); var budgetproviders = context.BudgetProvidences.ToList(); var accountingobject = context.AccountingObjects.ToList(); var projectexpenses = context.ProjectExpenses.ToList(); var activity = context.Activities.ToList(); var tasks = context.Tasks.ToList(); var topics = context.Topics.ToList(); banks = context.BankInfoes.ToList(); var department = context.Departments.ToList(); var fixedasset = context.FixedAssets.ToList(); var inventoryitems = context.InventoryItems.ToList(); var stocks = context.Stocks.ToList(); var resultcontext = context.GLVouchers.ToList(); var budgetexpense = context.BudgetExpenses.ToList(); //Detail var butransfers = context.GLVouchers.ToList(); var parallel = context.GLVoucherDetailParallels.ToList(); var detailtaxs = context.GLVoucherDetailTaxes.ToList(); //BATranfers var batranfers = context.BATransfers.ToList(); var batranferdetails = context.BATransferDetails.ToList(); var batranferparallels = context.BATransferDetailParallels.ToList(); #region Detail foreach (var result in resultcontext) { var newresult = new GLVoucherEntity(); newresult.RefId = result.RefID.ToString(); newresult.RefType = ConvRefType.ConvRefType(result.RefType); newresult.RefDate = result.RefDate; newresult.PostedDate = result.PostedDate; newresult.RefNo = result.RefNo; newresult.CurrencyCode = result.CCY == null ? null : result.CCY.CurrencyID; newresult.ExchangeRate = result.ExchangeRate; newresult.ParalellRefNo = result.ParalellRefNo; newresult.JournalMemo = result.JournalMemo; newresult.TotalAmount = result.TotalAmount; newresult.TotalAmountOC = result.TotalAmountOC; newresult.ParentRefId = result.ParentRefID.ToString(); newresult.Posted = result.Posted; newresult.PostVersion = result.PostVersion; newresult.EditVersion = result.EditVersion; newresult.AdvancePaymentOrder = result.AdvancePaymentOrder; newresult.BUTransferRefId = string.IsNullOrEmpty(result.QLTSRefNo) ? null : butransfers.FirstOrDefault(x => x.RefNo == result.QLTSRefNo).RefID.ToString(); newresult.GLVoucherDetails = result.GLVoucherDetails.Count <= 0 ? null : GLVoucherDetails(result.GLVoucherDetails.ToList(), result.RefID.ToString()); newresult.GLVoucherDetailParallels = result.GLVoucherDetailParallels.Count <= 0 ? null : GLVoucherDetailParallels(result.GLVoucherDetailParallels.ToList(), result.RefID.ToString()); newresult.GLVoucherDetailTaxes = result.GLVoucherDetailTaxes.Count <= 0 ? null : GLVoucherDetailTaxes(result.GLVoucherDetailTaxes.ToList(), result.RefID.ToString()); buentity.Add(newresult); } #endregion #region BATranfers foreach (var result in batranfers) { var newresult = new GLVoucherEntity(); newresult.RefId = result.RefID.ToString(); newresult.RefType = ConvRefType.ConvRefType(result.RefType); newresult.RefDate = result.RefDate; newresult.PostedDate = result.PostedDate; newresult.RefNo = result.RefNo; newresult.CurrencyCode = result.CCY == null ? null : result.CCY.CurrencyID; newresult.ExchangeRate = result.ExchangeRate; newresult.ParalellRefNo = result.ParalellRefNo; newresult.JournalMemo = result.JournalMemo; newresult.TotalAmount = result.TotalAmount; newresult.TotalAmountOC = result.TotalAmountOC; //newresult.ParentRefId = result.ParentRefID.ToString(); newresult.Posted = result.Posted; newresult.PostVersion = result.PostVersion; newresult.EditVersion = result.EditVersion; //newresult.AdvancePaymentOrder = result.AdvancePaymentOrder; //newresult.BUTransferRefId = string.IsNullOrEmpty(result.QLTSRefNo) ? null : butransfers.FirstOrDefault(x => x.RefNo == result.QLTSRefNo).RefID.ToString(); newresult.GLVoucherDetails = result.BATransferDetails.Count <= 0 ? null : GLVoucherDetailFromBATransfers(result.BATransferDetails.ToList(), result.RefID.ToString()); newresult.GLVoucherDetailParallels = result.BATransferDetailParallels.Count <= 0 ? null : GLVoucherDetailParallelFromBATransfers(result.BATransferDetailParallels.ToList(), result.RefID.ToString()); //newresult.GLVoucherDetailTaxes = result.GLVoucherDetailTaxes.Count <= 0 ? null : GLVoucherDetailTaxes(result.GLVoucherDetailTaxes.ToList(), result.RefID.ToString()); buentity.Add(newresult); } #endregion } return(buentity); }