Пример #1
0
        public IActionResult ShopPortfolio([FromRoute(Name = "id")] string shopID, [FromRoute(Name = "status")] string shopStatus)
        {
            // To Get The Vehicle Requests , excluding those that have been Serviced and completed

            var actuall = _repo.GetVehReqs.Include(a => a.ServiceReqDb).ThenInclude(ap => ap.Assign.Technician).Include(ap => ap.ServiceReqDb).ThenInclude(ap => ap.Assign.Service)
                          .Include(sp => sp.ServicedHistDb).Include(dl => dl.MessageDb)
                          .Include(sp => sp.Vehicle).ThenInclude(s => s.User).Where(vh => vh.UserId.Equals(int.Parse(Request.Cookies["UserID"])));

            //string returnString = String.Empty;

            foreach (var vehRequest in actuall)
            {
                if (vehRequest.ServicedHistDb.Count != 0 || vehRequest.MessageDb.Count != 0)
                {
                    actuall = actuall.Where(sp => sp != vehRequest);
                }
            }


            // var shopTeches = _repo.GetShopTeches.Include(at => at.AssignedTechDb).ThenInclude(sb => sb.Service).Where(ap => ap.UserId.Equals(int.Parse(shopID)));

            var shop_user = new ShopListView
            {
                User          = _repo.GetUserDbs.Where(s => s.UserId.Equals(int.Parse(Request.Cookies["UserID"]))).Include(s => s.Image).FirstOrDefault(),
                ShopTeches    = _repo.GetShopTeches.Where(s => s.UserId.Equals(int.Parse(Request.Cookies["UserID"]))).Include(a => a.AssignedTechDb).ThenInclude(s => s.Service),
                ShopServices  = _repo.GetShopServices.Where(s => s.UserId.Equals(int.Parse(Request.Cookies["UserID"]))),
                ShopReqVehDbs = actuall
            };

            return(View(shop_user));
        }
Пример #2
0
        public ShopListViewModel(ShopListView shopListView)
        {
            this.shopListView = shopListView;
            this.shopListView.AddBtn.Click      += AddBtn_Click;
            this.shopListView.EditBtn.Click     += EditBtn_Click;
            this.shopListView.ValidateBtn.Click += ValidateBtn_Click;

            this.shopListView.ShopListUserControl.LoadItems();
        }
Пример #3
0
        private void BindData()
        {
            List <SqlParameter> parms = new List <SqlParameter>();

            if (GenreID > 0)
            {
                parms.Add(new SqlParameter("@GenreID", GenreID));
            }

            ShopListView.DataSource = DB.Get("dbo.ShopSeriesSelect", parms.ToArray());
            ShopListView.DataBind();
        }