public ActionResult AddProgressAjax(GoalProgress model)
 {
     if (ModelState.IsValid == true)
     {
         try
         {
             GoalProgress Goalprogress = IBOVirtualAPI.GetProgress(model.goalId.ToString());
             if (model.progress == 100)
             {
                 Goal Goal = IBOVirtualAPI.Get <Goal>(model.goalId.ToString());
                 Goal.completed = true;
                 string result = IBOVirtualAPI.Update <Goal>(Goal.goalId.ToString(), Goal);
             }
             if (Goalprogress == null)
             {
                 bool result = IBOVirtualAPI.CreateProgress(model);
             }
             else
             {
                 model.progressId = Goalprogress.progressId;
                 string result = IBOVirtualAPI.UpdateProgress(model.progressId.ToString(), model);
             }
             return(Json(model));
         }
         catch
         {
             return(Json(new { success = false }));
         }
     }
     else
     {
         return(Json(new { success = false }));
     }
 }