public IList <ACJournalEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <ACJournalEntity> aCJournalEntityList = new List <ACJournalEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = ACJournalEntity.FLD_NAME_JournalID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; aCJournalEntityList = FCCACJournal.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (aCJournalEntityList != null && aCJournalEntityList.Count > 0) { totalRowCount = aCJournalEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCJournalEntityList ?? new List <ACJournalEntity>()); }
public IList <ACJournalEntity> GetData() { IList <ACJournalEntity> aCJournalEntityList = new List <ACJournalEntity>(); try { aCJournalEntityList = FCCACJournal.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (aCJournalEntityList != null && aCJournalEntityList.Count > 0) { totalRowCount = aCJournalEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(aCJournalEntityList ?? new List <ACJournalEntity>()); }
private void BuildLabel() { DateTime asAt = MiscUtil.ParseToDateTime(txtAsAt.Text.ToString()); String fe = SqlExpressionBuilder.PrepareFilterExpression(ACJournalEntity.FLD_NAME_ClassTypeID, MasterDataConstants.ACClassType.ASSETS.ToString(), SQLMatchType.Equal); String fe_date = ACJournalEntity.FLD_NAME_TransactionDateTime + " <= '" + asAt.ToString() + "'"; String fe_fiscalYear = SqlExpressionBuilder.PrepareFilterExpression(ACJournalEntity.FLD_NAME_FiscalYearID, ddlFiscalYearID.SelectedValue.ToString(), SQLMatchType.Equal); String fe_common = SqlExpressionBuilder.PrepareFilterExpression(fe_fiscalYear, SQLJoinType.AND, fe_date); fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe_date); IList <ACJournalEntity> lstAsset = FCCACJournal.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression); Decimal totalAsset = 0, totalLiabilities; if (lstAsset != null && lstAsset.Count > 0) { Decimal tempDebit, tempCredit; var resultDebit = (from s in lstAsset where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.DEBIT select s.Amount).Sum(val => val); var resultCredit = (from s in lstAsset where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.CREDIT select s.Amount).Sum(val => val); tempDebit = resultDebit; tempCredit = resultCredit; totalAsset = tempDebit - tempCredit; lblTotalAsset.Text = Math.Round(totalAsset, 2).ToString(); } else { totalAsset = 0; lblTotalAsset.Text = Math.Round(totalAsset, 2).ToString(); } String fe_liabilities = SqlExpressionBuilder.PrepareFilterExpression(ACJournalEntity.FLD_NAME_ClassTypeID, MasterDataConstants.ACClassType.LIABILITIES.ToString(), SQLMatchType.Equal); fe_liabilities = SqlExpressionBuilder.PrepareFilterExpression(fe_liabilities, SQLJoinType.AND, fe_common); IList <ACJournalEntity> lstliabilities = FCCACJournal.GetFacadeCreate().GetIL(null, null, String.Empty, fe_liabilities, DatabaseOperationType.LoadWithFilterExpression); if (lstliabilities != null && lstliabilities.Count > 0) { Decimal tempDebit, tempCredit; var resultDebit = (from s in lstliabilities where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.DEBIT select s.Amount).Sum(val => val); var resultCredit = (from s in lstliabilities where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.CREDIT select s.Amount).Sum(val => val); tempDebit = resultDebit; tempCredit = resultCredit; totalLiabilities = tempDebit - tempCredit; lblTotalLiabilities.Text = Math.Round(totalLiabilities, 2).ToString(); lblTotalReturn.Text = Math.Round((totalAsset - totalLiabilities), 2).ToString(); } else { totalLiabilities = 0; lblTotalLiabilities.Text = Math.Round(totalLiabilities, 2).ToString(); } }