public void CanDoPostBackEdit()
 {
     //ACT
     var fdp = new FDP {FDPID = 1, Name = "..."};
     var result = _fdpController.Edit(fdp);
     //Assert
     Assert.IsInstanceOf<ActionResult>(result);
     Assert.IsInstanceOf<Unit>(fdp.FDPID);
 }
 public void CanDoPostBackCreate()
 {
     //ACT
     var fdp = new FDP {Name = "..."};
     var result = _fdpController.Create(fdp);
     //Assert
     Assert.IsInstanceOf<ActionResult>(result);
     Assert.IsInstanceOf<int>(fdp.FDPID);
 }
Ejemplo n.º 3
0
        public virtual ActionResult Create(FDP fdp)
        {
            if (ModelState.IsValid)
            {
                _FDPService.AddFDP(fdp);
                return Json(new { success = true });
            }

            return PartialView(fdp);
        }
Ejemplo n.º 4
0
        public virtual ActionResult Edit(FDP fdp)
        {
            if (ModelState.IsValid)
            {

                _FDPService.EditFDP(fdp);

                //return RedirectToAction("Index");
                return Json(new { success = true });
            }

            ViewBag.FDPID = new SelectList(_FDPService.GetAllFDP(), "FDPID", "Name", fdp.FDPID);
            return PartialView(fdp);
        }