public IHttpActionResult PutModuleNote(int id, ModuleNote moduleNote) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != moduleNote.Id) { return(BadRequest()); } db.Entry(moduleNote).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ModuleNoteExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
bool ML_LoadPatterns() { int t, s, tracks = 0; m_Module.AllocPatterns(); m_Module.AllocTracks(); /* Allocate temporary buffer for loading and converting the patterns */ patbuf = new ModuleNote[64 * m_Module.numchn]; for (int i = 0; i < patbuf.Length; i++) { patbuf[i] = new ModuleNote(); } if (trekker != 0 && m_Module.numchn == 8) { /* Startrekker module dual pattern */ for (t = 0; t < m_Module.numpat; t++) { for (s = 0; s < (64U * 4); s++) { patbuf[s].a = m_Reader.Read_byte(); patbuf[s].b = m_Reader.Read_byte(); patbuf[s].c = m_Reader.Read_byte(); patbuf[s].d = m_Reader.Read_byte(); } for (s = 0; s < 4; s++) { if (!ConvertTrack(patbuf, s, 4, ref m_Module.tracks, tracks++)) { return(false); } } for (s = 0; s < (64U * 4); s++) { patbuf[s].a = m_Reader.Read_byte(); patbuf[s].b = m_Reader.Read_byte(); patbuf[s].c = m_Reader.Read_byte(); patbuf[s].d = m_Reader.Read_byte(); } for (s = 0; s < 4; s++) { if (!ConvertTrack(patbuf, s, 4, ref m_Module.tracks, tracks++)) { return(false); } } } } else { /* Generic module pattern */ for (t = 0; t < m_Module.numpat; t++) { /* Load the pattern into the temp buffer and convert it */ for (s = 0; s < (64U * m_Module.numchn); s++) { patbuf[s].a = m_Reader.Read_byte(); patbuf[s].b = m_Reader.Read_byte(); patbuf[s].c = m_Reader.Read_byte(); patbuf[s].d = m_Reader.Read_byte(); } for (s = 0; s < m_Module.numchn; s++) { if (!ConvertTrack(patbuf, s, m_Module.numchn, ref m_Module.tracks, tracks++)) { return(false); } } } } return(true); }
public ModuleNoteDecorator(ModuleNote _entData, Customer _customer) { entData = _entData; customer = _customer; }