public async Task <JsonResult> GetByID(string id, string api) { try { var data = LocationSessionService.GetByID(Guid.Parse(id), Guid.Parse(api)); return(Success(LocationSessionVM.MToVM(data))); } catch { return(Failed(MessageUtility.ServerError())); } }
public async Task <JsonResult> Insert() { try { var id = Guid.NewGuid(); var name = Request.Form["name"]; var api = Guid.Parse(Request.Form["api"]); if (LocationSessionService.Insert(id, name, api)) { return(Success(id.ToString())); } return(Failed(MessageUtility.ServerError())); } catch { return(Failed(MessageUtility.ServerError())); } }