예제 #1
0
        public async Task <ActionResult> EditServGroup(int id)
        {
            ServGroup content = await Task.Run(() => Context.ServGroup.Where(x => x.id == id).ToList()[0]);

            ViewBag.Title = content.name;

            return(View(content));
        }
예제 #2
0
        public async Task <ActionResult> EditServGroup(ServGroup group, string command = "", string modalCommand = "")
        {
            if (command.Equals("Save"))
            {
                if (ModelState.IsValid)
                {
                    Context.Entry(group).State = EntityState.Modified;
                    await Context.SaveChangesAsync();

                    ViewBag.Title = group.name;
                }
                return(View(group));
            }
            //else if (command.Equals("Exit"))
            //{
            //    return RedirectToAction("ServGroupsAll");
            //}

            return(RedirectToAction("ServGroupsAll"));
        }