Ejemplo n.º 1
0
        public IActionResult GetAll([FromBody] DataManagerRequest dm)
        {
            IEnumerable <HistorySaleView> DataSource = data.GetAll <HistorySaleView>();
            DataOperations operation = new DataOperations();

            if (dm.Search != null && dm.Search.Count > 0)
            {
                DataSource = operation.PerformSearching(DataSource, dm.Search); //Search
            }
            if (dm.Sorted != null && dm.Sorted.Count > 0)                       //Sorting
            {
                DataSource = operation.PerformSorting(DataSource, dm.Sorted);
            }
            if (dm.Where != null && dm.Where.Count > 0) //Filtering
            {
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
            }
            int count = DataSource.Cast <HistorySaleView>().Count();

            if (dm.Skip != 0)
            {
                DataSource = operation.PerformSkip(DataSource, dm.Skip);   //Paging
            }
            if (dm.Take != 0)
            {
                DataSource = operation.PerformTake(DataSource, dm.Take);
            }
            return(dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource));
        }
Ejemplo n.º 2
0
        public IActionResult ForDropDown([FromBody] DataManagerRequest dm)
        {
            IEnumerable <Customers> DataSource = data.GetAll <Customers>();
            DataOperations          operation  = new DataOperations();

            if (dm.Search != null && dm.Search.Count > 0)
            {
                DataSource = operation.PerformSearching(DataSource, dm.Search);  //Search
            }
            int count = DataSource.Cast <Customers>().Count();

            return(dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource));
        }
Ejemplo n.º 3
0
        public ActionResult allNews()
        {
            ClientModel m = new ClientModel();

            m.lst_newsv = data.GetAll <News>();
            return(View(m));
        }
Ejemplo n.º 4
0
        public ActionResult News()
        {
            AdminNewModel n = new AdminNewModel();

            n.lst_news = data.GetAll <News>();
            return(View(n));
        }
        public IActionResult ForDropDown([FromBody] DataManagerRequest dm)
        {
            IEnumerable <ProductSales> DataSource = data.GetAll <ProductSales>();

            DataOperations operation = new DataOperations();

            if (dm.Search != null && dm.Search.Count > 0)
            {
                DataSource = operation.PerformSearching(DataSource, dm.Search); // Search
            }
            if (dm.Where != null && dm.Where.Count > 0)                         // Filtering
            {
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator);
            }
            int count = DataSource.Cast <ProductSales>().Count();

            return(dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource));
        }
Ejemplo n.º 6
0
 public ActionResult GetRole()
 {
     return(Json(data.GetAll <Roles>()));
 }
Ejemplo n.º 7
0
        public IActionResult Index()
        {
            var result       = data.GetAll <SalesTotalByDayView>().LastOrDefault();
            var resultReturn = data.GetAll <ReturnTotalByDayView>().LastOrDefault();

            if (result == null)
            {
                ViewBag.pribl  = 0;
                ViewBag.totall = new SalesTotalByDayView()
                {
                    RegDt = DateTime.Now.Date, IncomeCost = 0, SaleTotal = 0
                };
            }
            else
            {
                ViewBag.pribl  = result.SaleTotal - result.IncomeCost;
                ViewBag.totall = result;
            }
            if (resultReturn == null)
            {
                ViewBag.rtotall = new ReturnTotalByDayView()
                {
                    RegDt = DateTime.Now.Date, ReturnCost = 0
                };
            }
            else
            {
                ViewBag.rtotall = resultReturn;
            }
            ViewBag.PrixodobTG   = data.GetAll <AvProfit>().FirstOrDefault().TotalIncomeTG;
            ViewBag.ProdajaobTG  = data.GetAll <AvProfit>().FirstOrDefault().TotalSaleTG;
            ViewBag.OptovayaobTG = data.GetAll <AvProfit>().FirstOrDefault().TotalOptTG;

            ViewBag.Prixodob   = data.GetAll <AvProfit>().FirstOrDefault().TotalIncome;
            ViewBag.Prodajaob  = data.GetAll <AvProfit>().FirstOrDefault().TotalSale;
            ViewBag.Optovayaob = data.GetAll <AvProfit>().FirstOrDefault().TotalOpt;
            return(View());
        }