コード例 #1
0
        public ActionResult ManageRims()
        {
            ManageRimsViewModel vm      = new ManageRimsViewModel();
            tblRimsService      service = new tblRimsService();

            vm.janee       = JaNee.Ja;
            vm.neeja       = JaNee.Nee;
            vm.rims        = service.getRims();
            vm.RimsInStock = service.getRims().Where(a => a.Sold == 0).Count();
            vm.images      = service.getRimImages().ToList();
            return(View(vm));
        }
コード例 #2
0
        public void SoldChanged(string parameter)
        {
            string[] parameters = parameter.Split('b');
            Debug.WriteLine(parameter);
            tblRimsService service = new tblRimsService();

            if (parameters[0].Equals("0"))
            {
                Debug.WriteLine("Ja");
                service.SellRim(service.getRims().ElementAt(Int32.Parse(parameters[1])), true);
            }
            else
            {
                if (parameters[0].Equals("1"))
                {
                    Debug.WriteLine("Nee");
                    service.SellRim(service.getRims().ElementAt(Int32.Parse(parameters[1])), false);
                }
            }
        }
コード例 #3
0
        public ActionResult Rims()
        {
            tblCarsService cservice = new tblCarsService();
            tblRimsService service  = new tblRimsService();
            RimsViewModel  vm       = new RimsViewModel();

            vm.images = service.getRimImages();
            vm.rims   = service.getRims();
            if (vm.rims.Count() > 0)
            {
                vm.CarsInStock = cservice.getAllCars().Where(a => a.Sold == 0).Count();
            }
            return(View(vm));
        }