Beispiel #1
0
        public async Task <ActionResult> Create(TypeRest typeRest)
        {
            context.TypeRests.Add(typeRest);
            await context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public int Update(String id_trest, String trest_name)
        {
            TypeRest edit = new TypeRest
            {
                id_trest   = id_trest,
                trest_name = trest_name
            };

            return(tr.Update(edit));
        }
Beispiel #3
0
        public int Insert(String id_trest, String trest_name)
        {
            TypeRest nuevo = new TypeRest
            {
                id_trest   = id_trest,
                trest_name = trest_name
            };

            return(tr.Insert(nuevo));
        }
Beispiel #4
0
        public ActionResult ConfirmDelete(int id)
        {
            TypeRest typerest = context.TypeRests.Find(id);

            if (typerest == null)
            {
                return(View("NotFound"));
            }
            else
            {
                return(View(typerest));
            }
        }
Beispiel #5
0
        public ActionResult Edit(int?id)
        {
            TypeRest service = context.TypeRests.Find(id);

            return(View(service));
        }