Exemplo n.º 1
0
        public IActionResult DeleteBete(int id)
        {
            PersonMetoder pm = new PersonMetoder();



            int i = pm.DeleteBete(id, out string error);

            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Sokning()
        {
            PersonMetoder pmTotalus = new PersonMetoder();

            FiltreringModell myModel = new FiltreringModell
            {
                TotalusFiltLista = pmTotalus.GetFiskarWithDataSet(out string errormsg)
            };

            ViewBag.error = errormsg;

            return(View(myModel));
        }
Exemplo n.º 3
0
        public IActionResult VisaFiskar()
        {
            List <Totalus> Fisklista = new List <Totalus>();
            PersonMetoder  pm        = new PersonMetoder();
            string         error     = "";

            Fisklista = pm.GetFiskarWithDataSet(out error);

            ViewBag.error = error;



            return(View(Fisklista));
        }
Exemplo n.º 4
0
        public IActionResult VisaPersoner()
        {
            List <Personer> PersonLista = new List <Personer>();
            PersonMetoder   pm          = new PersonMetoder();

            string error = "";

            PersonLista = pm.GetPersonerWithDataSet(out error);

            ViewBag.error = error;


            return(View(PersonLista));
        }
Exemplo n.º 5
0
        public IActionResult VisaBeten()
        {
            List <Beten>  BetesLista = new List <Beten>();
            PersonMetoder pm         = new PersonMetoder();

            string error = "";

            BetesLista = pm.GetBetenWithDataSet(out error);

            ViewBag.error = error;


            return(View(BetesLista));
        }
Exemplo n.º 6
0
        public ActionResult Sortering(string sort)
        {
            ViewData["sort"] = sort;
            PersonMetoder pmTotalus = new PersonMetoder();


            FiltreringModell myModel = new FiltreringModell
            {
                TotalusFiltLista = pmTotalus.SorteraNamn(out string errormsg, sort)
            };

            ViewBag.sort  = sort;
            ViewBag.error = errormsg;

            return(View(myModel));
        }
Exemplo n.º 7
0
        public ActionResult Filtrering(string ValdArt)
        {
            int i = Convert.ToInt32(ValdArt);

            ViewData["ValdArt"] = i;

            PersonMetoder pmTotalus = new PersonMetoder();

            FiltreringModell myModel = new FiltreringModell
            {
                TotalusFiltLista = pmTotalus.GetFiskarWithDataSet(out string errormsg, i)
            };


            ViewData["ValdArt"] = i;
            ViewBag.error       = errormsg;
            return(View(myModel));
        }
Exemplo n.º 8
0
        public IActionResult InsertBete(IFormCollection fc)
        {
            Beten         b1 = new Beten();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";


            b1.ID    = Convert.ToInt32(fc["betenr"]);
            b1.Color = fc["color"];
            b1.Typ   = fc["typ"];

            i             = pm.InsertBete(b1, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }
Exemplo n.º 9
0
        public IActionResult InsertPerson(IFormCollection fc)
        {
            Personer      p1 = new Personer();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";


            p1.Persnr = Convert.ToInt64(fc["persnr"]);
            p1.Namn   = fc["namn"];
            p1.Telnr  = fc["telnr"];

            i             = pm.InsertPerson(p1, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(RedirectToAction("VisaFiskar"));
        }
Exemplo n.º 10
0
        public IActionResult UpdateBeten(IFormCollection fc, int id)
        {
            Beten         b1 = new Beten();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";


            b1.ID    = Convert.ToInt32(fc["Betenr"]);
            b1.Typ   = fc["Typ"];
            b1.Color = fc["Color"];

            i             = pm.UpdateBeten(b1, id, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }
Exemplo n.º 11
0
        public IActionResult UpdatePersoner(IFormCollection fc, int id)
        {
            Personer      b1 = new Personer();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";


            b1.Persnr = Convert.ToInt64(fc["Persnr"]);
            b1.Namn   = fc["Namn"];
            b1.Telnr  = fc["Telnr"];

            i             = pm.UpdatePersoner(b1, id, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }
Exemplo n.º 12
0
        public IActionResult InsertFisk(IFormCollection fc)
        {
            Fiskar        f1 = new Fiskar();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";

            f1.Art    = fc["Art"];
            f1.Vikt   = Convert.ToInt32(fc["Vikt"]);
            f1.Vatten = fc["Vatten"];
            f1.Persnr = Convert.ToInt64(fc["persnr"]);
            f1.Betenr = Convert.ToInt32(fc["Betenr"]);


            i             = pm.InsertFisk(f1, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }
Exemplo n.º 13
0
        public IActionResult UpdateFisk(IFormCollection fc, int id)
        {
            Fiskar        b1 = new Fiskar();
            PersonMetoder pm = new PersonMetoder();

            int    i     = 0;
            string error = "";


            b1.ID     = Convert.ToInt32(fc["FiskID"]);
            b1.Art    = fc["Art"];
            b1.Vikt   = Convert.ToInt32(fc["Vikt"]);
            b1.Vatten = fc["Vatten"];


            i             = pm.UpdateFisk(b1, id, out error);
            ViewBag.error = error;
            ViewBag.antal = i;

            return(View());
        }