Esempio n. 1
0
        public IEnumerable <ProfitLossReportModel> GetProfitLossReportList(int?productId, DateTime?FromDate, DateTime?ToDate)
        {
            IQueryable <GL_GetProfitLossReport_Result> result = ent.GL_GetProfitLossReport(productId, FromDate, ToDate).AsQueryable();

            List <ProfitLossReportModel> model = new List <ProfitLossReportModel>();

            foreach (var item in result)
            {
                //ProfitLossReportModel obj = new ProfitLossReportModel
                //{
                //   txtLedgerName =item.LedgerName,
                //   txtExpenses = Convert.ToDecimal( item.Expenses),
                //   txtIncome = Convert.ToDecimal( item.Income),
                //};

                var obj = new ProfitLossReportModel();
                obj.txtLedgerName = item.LedgerName;
                obj.txtExpenses   = Convert.ToDecimal(item.Expenses);
                obj.txtIncome     = Convert.ToDecimal(item.Income);

                totalExpenses = totalExpenses + Convert.ToDecimal(item.Expenses);
                totalIncome   = totalIncome + Convert.ToDecimal(item.Income);

                obj.txtSumExpenses = totalExpenses;
                obj.txtSumIncome   = totalIncome;

                model.Add(obj);
            }
            return(model.AsEnumerable());
        }
Esempio n. 2
0
        public ActionResult Index(int?productId, DateTime?FromDate, DateTime?ToDate)
        {
            if (Request.IsAjaxRequest())
            {
                var viewModel = new ProfitLossReportModel
                {
                    ProfitLossReportlist = ser.GetProfitLossReportList(productId, FromDate, ToDate)
                };
                return(PartialView("ListPartial", viewModel));
            }

            var productList = ent.Core_Products.ToList();

            ViewData["ProductList"] = new SelectList(productList, "ProductId", "ProductName", 0);

            return(View());
        }
Esempio n. 3
0
        public ActionResult Index(ProfitLossReportModel model)
        {
            if (Request.IsAjaxRequest())
            {
                DateTime?FDate;
                if (model.FromDate == DateTime.MinValue)
                {
                    FDate = null;
                }
                else
                {
                    FDate = model.FromDate;
                }

                DateTime?TDate;
                if (model.ToDate == DateTime.MinValue)
                {
                    TDate = null;
                }
                else
                {
                    TDate = model.ToDate;
                }
                var productList = ent.Core_Products.ToList();

                ViewData["ProductList"] = new SelectList(productList, "ProductId", "ProductName", 0);
                int?id = model.ProductId;


                var viewModel = new ProfitLossReportModel
                {
                    ProfitLossReportlist = ser.GetProfitLossReportList(id, FDate, TDate)
                };
                return(PartialView("ListPartial", viewModel));
            }

            return(View());
        }
Esempio n. 4
0
        public IEnumerable <ProfitLossReportModel> GetBalanceSheetReportList(int?productId, DateTime?FromDate, DateTime?ToDate)
        {
            IQueryable <GL_GetBalanceSheetReport_Result> result = ent.GL_GetBalanceSheetReport(productId, FromDate, ToDate).AsQueryable();

            List <ProfitLossReportModel> model = new List <ProfitLossReportModel>();

            foreach (var item in result)
            {
                var obj = new ProfitLossReportModel();
                obj.txtLedgerName  = item.LedgerName;
                obj.txtLiabilities = Convert.ToDecimal(item.Liabilities);
                obj.txtAsset       = Convert.ToDecimal(item.Accet);

                totalLiabilities = totalLiabilities + Convert.ToDecimal(item.Liabilities);
                totalAsset       = totalAsset + Convert.ToDecimal(item.Accet);

                obj.txtSumLiabilities = totalLiabilities;
                obj.txtSumAsset       = totalAsset;

                model.Add(obj);
            }
            return(model.AsEnumerable());
        }