예제 #1
0
        public IEnumerable <TrialBalanceSummaryViewModel> GetTrialBalanceSummary(string UserName)
        {
            var Settings = new TrialBalanceSettingService(_unitOfWork).GetTrailBalanceSetting(UserName);

            string SiteId     = Settings.SiteIds;
            string DivisionId = Settings.DivisionIds;
            string FromDate   = Settings.FromDate.HasValue ? Settings.FromDate.Value.ToString("dd/MMM/yyyy") : "";
            string ToDate     = Settings.ToDate.HasValue ? Settings.ToDate.Value.ToString("dd/MMM/yyyy") : "";
            string CostCenter = Settings.CostCenter;

            SqlParameter SqlParameterSiteId     = new SqlParameter("@Site", !string.IsNullOrEmpty(SiteId) ? SiteId : (object)DBNull.Value);
            SqlParameter SqlParameterDivisionId = new SqlParameter("@Division", !string.IsNullOrEmpty(DivisionId) ? DivisionId : (object)DBNull.Value);
            SqlParameter SqlParameterFromDate   = new SqlParameter("@FromDate", FromDate);
            SqlParameter SqlParameterToDate     = new SqlParameter("@ToDate", ToDate);


            SqlParameter SqlParameterCostCenter = new SqlParameter("@CostCenter", !string.IsNullOrEmpty(CostCenter) ? CostCenter : (object)DBNull.Value);

            IEnumerable <TrialBalanceSummaryViewModel> TrialBalanceList;

            TrialBalanceList = db.Database.SqlQuery <TrialBalanceSummaryViewModel>("" + ConfigurationManager.AppSettings["DataBaseSchema"] + ".spTrialBalanceSummary @Site, @Division, @FromDate, @ToDate, @CostCenter", SqlParameterSiteId, SqlParameterDivisionId, SqlParameterFromDate, SqlParameterToDate, SqlParameterCostCenter).ToList();


            return(TrialBalanceList);
        }
예제 #2
0
        public IEnumerable <LedgerAccountGroupBalanceViewModel> GetLedgerGroupBalance(int?id, string UserName)
        {
            var Settings = new TrialBalanceSettingService(_unitOfWork).GetTrailBalanceSetting(UserName);

            string SiteId               = Settings.SiteIds;
            string DivisionId           = Settings.DivisionIds;
            string AsOnDate             = Settings.ToDate.HasValue ? Settings.ToDate.Value.ToString("dd/MMM/yyyy") : "";
            string CostCenter           = Settings.CostCenter;
            string LedgerAccountGroupId = null;

            if (id.HasValue && id.Value > 0)
            {
                LedgerAccountGroupId = id.ToString();
            }

            SqlParameter SqlParameterSiteId               = new SqlParameter("@Site", !string.IsNullOrEmpty(SiteId) ? SiteId : (object)DBNull.Value);
            SqlParameter SqlParameterDivisionId           = new SqlParameter("@Division", !string.IsNullOrEmpty(DivisionId) ? DivisionId : (object)DBNull.Value);
            SqlParameter SqlParameterDate                 = new SqlParameter("@AsOnDate", AsOnDate);
            SqlParameter SqlParameterLedgerAccountGroupId = new SqlParameter("LedgerAccountGroupId", !string.IsNullOrEmpty(LedgerAccountGroupId) ? LedgerAccountGroupId : (object)DBNull.Value);
            SqlParameter SqlParameterCostCenter           = new SqlParameter("@CostCenter", !string.IsNullOrEmpty(CostCenter) ? CostCenter : (object)DBNull.Value);

            IEnumerable <LedgerAccountGroupBalanceViewModel> TrialBalanceList = db.Database.SqlQuery <LedgerAccountGroupBalanceViewModel>("" + ConfigurationManager.AppSettings["DataBaseSchema"] + ".spLedgerAccountGroupBalance @Site, @Division, @AsOnDate, @LedgerAccountGroupId, @CostCenter", SqlParameterSiteId, SqlParameterDivisionId, SqlParameterDate, SqlParameterLedgerAccountGroupId, SqlParameterCostCenter).ToList();

            return(TrialBalanceList);
        }