Example #1
0
        public static IList <BO_TrialBalance> LoadTrialBalance(JQueryDataTableParamModel Param)
        {
            using (AprosysAccountingEntities db_aa = new AprosysAccountingEntities())
            {
                List <BO_TrialBalance> lst_cashFlow = new List <BussinessObject.BO_TrialBalance>();
                Param.End_Date = Param.End_Date.AddDays(1);
                var _Cashflow = db_aa.Report_TrialBalance(Param.Start_Date, Param.End_Date).ToList();
                foreach (var item in _Cashflow)
                {
                    BO_TrialBalance obj = new BussinessObject.BO_TrialBalance();
                    obj.account = item.ACCOUNT;

                    obj.debit  = item.DEBIT;
                    obj.credit = item.CREDIT;
                    lst_cashFlow.Add(obj);
                }
                BO_TrialBalance obj1 = new BussinessObject.BO_TrialBalance();
                obj1.account = "SUM";
                obj1.credit  = lst_cashFlow.Sum <BO_TrialBalance>(x => x.credit);
                obj1.debit   = lst_cashFlow.Sum <BO_TrialBalance>(x => x.debit);
                lst_cashFlow.Insert(0, obj1);
                return(lst_cashFlow);
            }
        }