//api checkin public static async Task <string> Check(int id_attivita) { try { ActivityComplete acc = (ActivityComplete)Application.Current.Properties["Activity"]; int id = acc.Id_activity; DateTime today = DateTime.Now; string apiUri = prefixApi + $"registration/check/{id}/{today.Date.ToString("yyyy-MM-dd")}"; var client = new HttpClient(); client.BaseAddress = new Uri(apiUri); string jsonData = ""; client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Application.Current.Properties["token"].ToString()); var content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(apiUri, content); var result = await response.Content.ReadAsStringAsync(); return(result); } catch (Exception ex) { var t = ex.Message; return(null); } }
public ActionResult DeleteConfirmed(Guid id) { ActivityComplete activityComplete = db.ActivityCompletes.Find(id); db.ActivityCompletes.Remove(activityComplete); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "completeId,activityId,dateCompleted,hrsToComplete,myDifficultyScore,myActivityScore,isFavorite,myActivityNotes")] ActivityComplete activityComplete) { if (ModelState.IsValid) { db.Entry(activityComplete).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(activityComplete)); }
public ActionResult Create([Bind(Include = "completeId,activityId,dateCompleted,hrsToComplete,myDifficultyScore,myActivityScore,isFavorite,myActivityNotes")] ActivityComplete activityComplete) { if (ModelState.IsValid) { activityComplete.completeId = Guid.NewGuid(); db.ActivityCompletes.Add(activityComplete); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(activityComplete)); }
// GET: ActivityCompletes/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ActivityComplete activityComplete = db.ActivityCompletes.Find(id); if (activityComplete == null) { return(HttpNotFound()); } return(View(activityComplete)); }
void Start() { activityComplete = activityCompletePanel.GetComponent<ActivityComplete>() as ActivityComplete; }