//CRUD FOR EVENT ENTITY public DataSet Get_ListEvent(eventModel currentEvent) {//~~~~~~~~~ READ EVENT DbCommand get_Event = db.GetStoredProcCommand("sp_readEvent"); db.AddInParameter(get_Event, "@eventID", DbType.Int32, currentEvent.eventID); DataSet ds = db.ExecuteDataSet(get_Event); return(ds);//RETURNS DATA SET FOR EVENT }
public Boolean Delete_ListEvent(eventModel currentEvent) {//~~~~~~~~~ DELETE EVENT Boolean success = false; DbCommand Delete_Event = db.GetStoredProcCommand("sp_DeleteEvent"); db.AddInParameter(Delete_Event, "@eventID", DbType.Int32, currentEvent.eventID); DataSet ds = db.ExecuteDataSet(Delete_Event); success = Convert.ToBoolean(Delete_Event.ExecuteNonQuery()); return(success);//REUTNRS IF EVENT WAS DELETED SUCCESSFULLYS }
public Boolean Update_ListEvent(eventModel currentEvent) {//~~~~~~~~~ UPDATE EVENT Boolean success = false; DbCommand Update_Event = db.GetStoredProcCommand("sp_UpdateEvent"); db.AddInParameter(Update_Event, "@eventID", DbType.Int32, currentEvent.eventID); db.AddInParameter(Update_Event, "@eventDescription", DbType.String, currentEvent.eventDescription); db.AddInParameter(Update_Event, "@eventTypeIDFK", DbType.Int32, currentEvent.eventTypeIDFK); db.AddInParameter(Update_Event, "@eventTypeDescription", DbType.String, currentEvent.eventTypeDescription); db.AddInParameter(Update_Event, "@eventDesignation", DbType.String, currentEvent.eventDesignation); success = Convert.ToBoolean(Update_Event.ExecuteNonQuery()); return(success);//RETURNS SUCCESS IF PROCEDURE WAS PASSED THROUGH }