Example #1
0
        public ActionResult ViewHealthDetails(string mName)
        {
            string       query = "select * from shooters.massshootings where mName = '" + mName + "'";
            massShooting ms    = TableUtils.queryToObject <massShooting>(query);

            return(View(ms));
        }
Example #2
0
        public ActionResult AddGunsToShooter(ShooterGuns _shooterGuns)
        {
            int              pageSize   = 10;
            int              pageNumber = 1;
            PagedList <gun>  _list      = new PagedList <gun>(TableUtils.queryToTable <gun>("SELECT * FROM shooters.gun where gDesc LIKE '%" + _shooterGuns._search + "%'"), pageNumber, pageSize);
            List <gunsOwned> _owned     = TableUtils.queryToTable <gunsOwned>("SELECT gName, gDesc, count(gName) as owned FROM shooters.gun natural join shooters.gunPurchase where first = '" + _shooterGuns._actorFirst + "' AND last = '" + _shooterGuns._actorLast + "' group by gName, gDesc");
            actor            _actor     = TableUtils.queryToObject <actor>("SELECT * FROM shooters.shooter where first= '" + _shooterGuns._actorFirst + "' AND last = '" + _shooterGuns._actorLast + "'");
            massShooting     ms         = TableUtils.queryToObject <massShooting>("select * from shooters.massshootings natural join shooters.massshootingrel where first = '" + _shooterGuns._actorFirst + "' AND last = '" + _shooterGuns._actorLast + "'");

            _shooterGuns._massShooting = ms;
            _shooterGuns._guns         = _list;
            _shooterGuns._gunsOwned    = _owned;
            _shooterGuns._actor        = _actor;
            return(View(_shooterGuns));
        }
Example #3
0
        public ActionResult AddGunsToShooter(string first, string last, int?page)
        {
            int              pageSize   = 10;
            int              pageNumber = page ?? 1;
            massShooting     ms         = TableUtils.queryToObject <massShooting>("select * from shooters.massshootings natural join shooters.massshootingrel where first = '" + first + "' AND last = '" + last + "'");
            PagedList <gun>  _list      = new PagedList <gun>(TableUtils.queryToTable <gun>("SELECT * FROM shooters.gun"), pageNumber, pageSize);
            List <gunsOwned> _owned     = TableUtils.queryToTable <gunsOwned>("SELECT gName, gDesc, count(gName) as owned FROM shooters.gun natural join shooters.gunPurchase where first = '" + first + "' AND last = '" + last + "' group by gName, gDesc");
            actor            _actor     = TableUtils.queryToObject <actor>("SELECT * FROM shooters.shooter where first= '" + first + "' AND last = '" + last + "'");
            ShooterGuns      model      = new ShooterGuns();

            model._actorFirst   = first;
            model._actorLast    = last;
            model._massShooting = ms;
            model._guns         = _list;
            model._gunsOwned    = _owned;
            model._actor        = _actor;
            return(View(model));
        }