public void UpdateBrigade(BrigadeDTO brigade) { Brigade b = MyMapper <BrigadeDTO, Brigade> .Map(brigade); DB.Brigades.Update(b); DB.Commit(); }
public void CreateBrigade(BrigadeDTO brigade) { Brigade newBrigade = MyMapper <BrigadeDTO, Brigade> .Map(brigade); DB.Brigades.Create(newBrigade); DB.Commit(); }
public ActionResult ConfirmBrigadeDeletion(int id, int code) { BrigadeDTO brigadeDTO = _brigadeService.GetBrigade(code); if (brigadeDTO != null) { _brigadeService.DeleteBrigade(code); return(RedirectToAction("Brigades")); } return(HttpNotFound()); }
public ActionResult DeleteBrigade(int id, int code) { BrigadeDTO brigadeDTO = _brigadeService.GetBrigade(code); if (brigadeDTO != null) { var brigade = MyMapper <BrigadeDTO, BrigadeViewModel> .Map(brigadeDTO); return(View(brigade)); } return(HttpNotFound()); }