public Boolean EditPC(PC editPC) { IRepository<PC> repository = new PCRepository(); PC pc = repository.findById(editPC.PCID); if (pc == null) { return false; } try { repository.Update(pc); } catch (Exception e) { e.GetBaseException(); return false; } return true; }
public Boolean DeletePC(int ID) { IRepository<PC> repository = new PCRepository(); PC deletedPC = repository.findById(ID); if (deletedPC == null || !checkDeletePC(ID)) { return false; } else { try { repository.Delete(deletedPC); } catch (Exception e) { e.GetHashCode(); } return true; } }
public PC GetEditPCByID(int PCID) { IRepository<PC> repository = new PCRepository(); PC pc = repository.findById(PCID); return pc; }