Exemplo n.º 1
0
 public bool DeleteFDP(FDP fdp)
 {
     if (fdp == null) return false;
     _unitOfWork.FDPRepository.Delete(fdp);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public void CanDoPostBackCreate()
 {
     //ACT
     var fdp = new FDP {Name = "..."};
     var result = _fdpController.Create(1);
     //Assert
     Assert.IsInstanceOf<ActionResult>(result);
     Assert.IsInstanceOf<int>(fdp.FDPID);
 }
Exemplo n.º 4
0
 public virtual ActionResult Create(AdminUnitModel fdps)
 {
     var fdp = new FDP
         {
             Name = fdps.UnitName,
             NameAM = fdps.UnitNameAM,
             AdminUnitID = fdps.SelectedWoredaId
         };
     if (ModelState.IsValid)
     {
         _FDPService.AddFDP(fdp);
         return Json(new { success = true });
     }
     return PartialView(fdps);
 }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
 public bool EditFDP(FDP fdp)
 {
     _unitOfWork.FDPRepository.Edit(fdp);
     _unitOfWork.Save();
     return true;
 }
Exemplo n.º 7
0
 public bool AddFDP(FDP fdp)
 {
     _unitOfWork.FDPRepository.Add(fdp);
     _unitOfWork.Save();
     return true;
 }