Beispiel #1
0
        // GET: User
        public ActionResult Client(int?page)
        {
            var da = new Courier.Models.DbModel.CourierEntities();

            string useremail = User.Identity.GetUserName();

            #region Errors
            //// var  myModel = new MultipleItems();
            //    ViewBag.Supports = (new SupportW().GetSupports(useremail)).Count();
            //  //  //myModel.Supports = new SupportW().GetSupports(useremail);

            //  ViewBag.Orders = (new Orders().GetOrders(useremail)).Count();
            //  // // myModel.Orders = new Orders().GetOrders(useremail);

            //ViewBag.Receipts = (new Receipts().GetReceipts(useremail)).Count();
            //  // // myModel.Receipts = new Receipts().GetReceipts(useremail);

            //  ViewBag.Receipts = (new Receipts().GetReceipts(useremail)).Count();

            //    ViewBag.Quotas = (new Quotas().GetQuota(useremail)).Count();
            //  // myModel.Quotas = new Quotas().GetQuota(useremail);
            //  var da = new Courier.Models.DbModel.CourierEntities();
            //  var orders = (from s in da.Orders
            //               select s).OrderByDescending(a => a.DateSpam);

            //  var tracks = (from s in da.Tracks
            //                select s).OrderByDescending(a => a.Order.DateSpam);
            //  return View(tracks);

            #endregion
            var q         = da.Orders.Where(a => a.User.UserName == useremail).Select(a => a.OrderID).Count();
            var supportno = new SupportW().GetSupports(useremail);
            ViewBag.Supports = supportno.Count();;

            ViewBag.Orders = q;

            ViewBag.Receipts = (new Receipts().GetReceipts(useremail)).Count();


            ViewBag.Receipts = (new Receipts().GetReceipts(useremail)).Count();

            ViewBag.Quotas = (new Quotas().GetQuota(useremail)).Count();
            string userId = User.Identity.GetUserId();



            var query = da.Tracks.Where(a => a.Order.userId == userId);


            query = query.OrderByDescending(s => s.Order.DateSpam);
            int pageSize   = 10;
            int pageNumber = (page ?? 1);


            return(View(query.ToPagedList(pageNumber, pageSize)));
        }
Beispiel #2
0
        // GET: Admin
        public ActionResult Index()
        {
            var da        = new CourierEntities();
            var q         = da.Orders.Select(a => a.OrderID).Count();
            var supportno = new SupportW().GetSupports(/*useremail*/);

            ViewBag.Supports = supportno.Count();
            ViewBag.Orders   = q;

            ViewBag.Receipts = (new Receipts().GetReceipts()).Count();
            ViewBag.Quotas   = (new Quotas().GetQuota()).Count();
            //string userId = User.
            //var query = da.Tracks.Where(a => a.Order.userId == userId);
            ViewBag.Users = (new Users().GetUsers()).Count();
            //  var da = new CourierEntities();

            var orders = from s in da.Tracks
                         select s;

            orders = orders.Take(5).OrderBy(a => a.Order.DateSpam);
            return(View(orders));
        }