예제 #1
0
        //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);
            }
        }
예제 #2
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            ActivityComplete activityComplete = db.ActivityCompletes.Find(id);

            db.ActivityCompletes.Remove(activityComplete);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 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));
 }
예제 #4
0
        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));
        }
예제 #5
0
        // 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));
        }
예제 #6
0
 void Start()
 {
     activityComplete = activityCompletePanel.GetComponent<ActivityComplete>() as ActivityComplete;
 }