private static Boolean GetRadioInstance(out IRadioInstance Radio) { Boolean Result = false; Radio = null; IMediaRadioManager RadioMan; Guid Iid = typeof(IMediaRadioManager).GUID; Int32 Res = CoCreateInstance(ref CLSID_BluetoothRadioManager, IntPtr.Zero, CLSCTX_INPROC_SERVER, ref Iid, out RadioMan); if (Succeeded(Res)) { IRadioInstanceCollection Instances; if (Succeeded(RadioMan.GetRadioInstances(out Instances))) { UInt32 Cnt; if (Succeeded(Instances.GetCount(out Cnt)) && Cnt > 0) { Result = Succeeded(Instances.GetAt(0, out Radio)); } Instances = null; } RadioMan = null; } return(Result); }
public ActionResult Edit([Bind(Include = "ID,FirstName,LastName")] RadioMan radioMan) { if (ModelState.IsValid) { repository.Update(radioMan); repository.Save(); return(RedirectToAction("Index", "Admin", "")); } return(View(radioMan)); }
// GET: RadioMen/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RadioMan radioMan = repository.GetByID(id); if (radioMan == null) { return(HttpNotFound()); } return(View(radioMan)); }