public ActionResult CreateInstrument(Instruments newInstruments) { if ((int)Session["Role_ID"] == 3 || (int)Session["Role_ID"] == 2) { instrumentsDAO InstrumentToCreate = _mapper.SingleInstrument(newInstruments); _InstrumentDataAccess.CreateInstruments(InstrumentToCreate); } return(RedirectToAction("InstrumentsView")); }
public ActionResult UpdateInstrument(Instruments _InstrumentsInfo) { if ((int)Session["Role_ID"] == 3 || (int)Session["Role_ID"] == 2) { instrumentsDAO _recievedInstrument = _mapper.SingleInstrument(_InstrumentsInfo); _InstrumentDataAccess.UpdateInstrument(_recievedInstrument); return(RedirectToAction("InstrumentsView")); } return(RedirectToAction("InstrumentsView")); }
public ActionResult DeleteInstrument(int Delete_Instruments) { if ((int)Session["Role_ID"] == 3) { instrumentsDAO _DeleteInstrument = new instrumentsDAO(); _DeleteInstrument.Instruments_ID = Delete_Instruments; _InstrumentDataAccess.DeleteInstruments(_DeleteInstrument); } return(RedirectToAction("InstrumentsView")); }
public Instruments SelectInstruments(instrumentsDAO _SelectInstrumentsToMap) { Instruments InstrumentsToReturn = new Instruments(); { Instruments _instrumentsToView = new Instruments(); _instrumentsToView.Instruments_ID = _SelectInstrumentsToMap.Instruments_ID; _instrumentsToView.InstrumentName = _SelectInstrumentsToMap.InstrumentName; _instrumentsToView.InstrumentDescription = _SelectInstrumentsToMap.InstrumentDescription; _instrumentsToView.InstrumentPrice = _SelectInstrumentsToMap.InstrumentPrice; _instrumentsToView.InstrumentsQuantity = _SelectInstrumentsToMap.InstrumentsQuantity; InstrumentsToReturn = _instrumentsToView; } return(InstrumentsToReturn); }
public instrumentsDAO SingleInstrument(Instruments _SingleInstrumentToMap) { instrumentsDAO InstrumentsToReturn = new instrumentsDAO(); { instrumentsDAO _instrumentsToView = new instrumentsDAO(); _instrumentsToView.Instruments_ID = _SingleInstrumentToMap.Instruments_ID; _instrumentsToView.InstrumentName = _SingleInstrumentToMap.InstrumentName; _instrumentsToView.InstrumentDescription = _SingleInstrumentToMap.InstrumentDescription; _instrumentsToView.InstrumentPrice = _SingleInstrumentToMap.InstrumentPrice; _instrumentsToView.InstrumentsQuantity = _SingleInstrumentToMap.InstrumentsQuantity; InstrumentsToReturn = _instrumentsToView; } return(InstrumentsToReturn); }