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 }));
     }
 }
Exemple #2
0
        public ActionResult UpCount(string id)
        {
            Book Book = IBOVirtualAPI.Get <Book>(id);

            Book.Count += 1;
            string result = IBOVirtualAPI.Update <Book>(Book.BookId.ToString(), Book);

            return(Json(new { success = true }));
        }
Exemple #3
0
 public ActionResult EditFollowupAjax(ContactFollowup model)
 {
     if (ModelState.IsValid == true)
     {
         string result = IBOVirtualAPI.Update <ContactFollowup>(model.followupId.ToString(), model);
         return(Json(new { success = true }));
     }
     else
     {
         return(Json(new { success = false }));
     }
 }
 public ActionResult EditDream(Dream model)
 {
     try
     {
         string result = IBOVirtualAPI.Update <Dream>(model.dreamId.ToString(), model);
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false }));
     }
 }
 public ActionResult EditGoal(Goal model)
 {
     try
     {
         string result = IBOVirtualAPI.Update <Goal>(model.goalId.ToString(), model);
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false }));
     }
 }
Exemple #6
0
 public ActionResult CompletFollowup(int id)
 {
     try
     {
         ContactFollowup followup = IBOVirtualAPI.Get <ContactFollowup>(id.ToString());
         followup.completed = true;
         string result = IBOVirtualAPI.Update <ContactFollowup>(followup.followupId.ToString(), followup);
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false }));
     }
 }
        public ActionResult Update(IBO model)
        {
            IBO iboUpdate = ModelParser.ParseIBO(model);

            iboUpdate.UserId      = WebSecurity.CurrentUserId;
            iboUpdate.datetime    = DateTime.Now;
            iboUpdate.facebookid  = FacebookId != null ? FacebookId : "";
            iboUpdate.accesstoken = AccessToken != null ? AccessToken : "";
            iboUpdate.level       = model.level;
            try
            {
                string result = IBOVirtualAPI.Update <IBO>(model.IBONum, iboUpdate);
                Cookies.Nullify();
            }
            catch { }
            return(RedirectToAction("Index", "Dashboard"));
        }
Exemple #8
0
 public ActionResult EditContactAjax(Contact model)
 {
     if (ModelState.IsValid == true)
     {
         try
         {
             string result = IBOVirtualAPI.Update <Contact>(model.contactId.ToString(), model);
             return(Json(new { success = true }));
         }
         catch
         {
             return(Json(new { success = false, message = "There was an issue with the server, please try again latter." }));
         }
     }
     else
     {
         return(Json(new { success = false, message = "Please correct all the issues." }));
     }
 }