public void UpdateNextRepair(NextRepairDTO nxtRepair) { NextRepair nr = MyMapper <NextRepairDTO, NextRepair> .Map(nxtRepair); DB.NextRepairs.Update(nr); DB.Commit(); }
public ActionResult ConfirmNextRepairDeletion(int id) { NextRepairDTO nextRepairDTO = _nextRepairService.GetNextRepair(id); if (nextRepairDTO != null) { _nextRepairService.DeleteNextRepair(id); return(RedirectToAction("NextRepairs")); } return(HttpNotFound()); }
public ActionResult DeleteNextRepair(int id) { NextRepairDTO nextRepairDTO = _nextRepairService.GetNextRepair(id); if (nextRepairDTO != null) { var nextRepair = MyMapper <NextRepairDTO, NextRepairViewModel> .Map(nextRepairDTO); return(View(nextRepair)); } return(HttpNotFound()); }
public ActionResult EditNextRepair(int id) { NextRepairDTO nextRepairDTO = _nextRepairService.GetNextRepair(id); if (nextRepairDTO != null) { ViewBag.Repairs = new SelectList(_nextRepairService.GetRepairTypes(), 1); ViewBag.Technicians = new SelectList(_nextRepairService.GetTechniciansNames(), 1); var nextRepair = MyMapper <NextRepairDTO, NextRepairViewModel> .Map(nextRepairDTO); return(View(nextRepair)); } return(HttpNotFound()); }
public NextRepairReportInfoDTO GetReport(int?equipmentId) { EquipmentDTO equipment = (new EquipmentService(DB)).GetEquipment(equipmentId.Value); NextRepairDTO nextRepair = (new NextRepairService(DB)).GetNextRepair(equipment.NextRepairs.Where(r => r.EquipmentId == equipmentId.Value).FirstOrDefault().Id) ?? null; NextRepairReportInfoDTO report = new NextRepairReportInfoDTO() { CurrentDate = DateTime.Now, Equipment = equipment, NextRepair = nextRepair, EquipmentId = equipmentId.Value, NextRepairId = nextRepair.Id }; return(report); }