コード例 #1
0
        public ActionResult Details(int id)
        {
            ViewBag.areas = new SelectList(areas, "areaId", "title");
            Dream dream = IBOVirtualAPI.Get <Dream>(id.ToString());

            return(PartialView(dream));
        }
コード例 #2
0
 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 }));
     }
 }
コード例 #3
0
 public ActionResult GoalsList(int id)
 {
     if (ibo != null)
     {
         List <Goal> goals = IBOVirtualAPI.GetIBOLevelGoals(ibo.IBONum, id.ToString());
         if ((goals.Count > 0) || (id == 0))
         {
             ViewBag.goalLevel = id;
             ViewBag.nextLevel = id + 1;
             List <Goal> goalsLevel = IBOVirtualAPI.GetIBOLevelGoals(ibo.IBONum, (id + 1).ToString());
             Dictionary <Timeframe, Goal> timeframeGoals = new Dictionary <Timeframe, Goal>();
             List <Timeframe>             timeframes     = IBOVirtualAPI.GetTimeFrames(id, ibo.languageId);
             Timeframe last = timeframes.Last();
             if (goalsLevel.Count < 1)
             {
                 ViewBag.lastItem = last;
             }
             foreach (Timeframe time in timeframes)
             {
                 Goal dream = (from d in goals
                               where d.timeframeId == time.timeframeId
                               select d).FirstOrDefault();
                 timeframeGoals.Add(time, dream);
             }
             return(PartialView(timeframeGoals));
         }
     }
     return(null);
 }
コード例 #4
0
        public ActionResult Update()
        {
            IBO ibo = IBOVirtualAPI.GetIBOByUId(WebSecurity.CurrentUserId.ToString());

            ViewBag.languages = languages;
            return(View(ibo));
        }
コード例 #5
0
 public ActionResult DreamList(int id)
 {
     if (ibo != null)
     {
         List <Dream> dreams = IBOVirtualAPI.GetDreamsUserLevel(ibo.IBONum, id.ToString());
         if ((dreams.Count > 0) || (id == 0))
         {
             ViewBag.dreamLevel = id;
             ViewBag.nextLevel  = id + 1;
             List <Dream> dreamsLevel = IBOVirtualAPI.GetDreamsUserLevel(ibo.IBONum, (id + 1).ToString());
             Dictionary <Timeframe, Dream> timeframeDreams = new Dictionary <Timeframe, Dream>();
             List <Timeframe> timeframes = IBOVirtualAPI.GetTimeFrames(id, ibo.languageId);
             Timeframe        last       = timeframes.Last();
             if (dreamsLevel.Count < 1)
             {
                 ViewBag.lastItem = last;
             }
             foreach (Timeframe time in timeframes)
             {
                 Dream dream = (from d in dreams
                                where d.timeframeId == time.timeframeId
                                select d).FirstOrDefault();
                 timeframeDreams.Add(time, dream);
             }
             return(PartialView(timeframeDreams));
         }
     }
     return(null);
 }
コード例 #6
0
 public ActionResult DreamMV(DreamsMV dream)
 {
     try
     {
         DreamsMV dreammv = new DreamsMV();
         dreammv.IBONum  = ibo.IBONum;
         dreammv.vision  = dream.vision;
         dreammv.mission = dream.mission;
         dreammv.purpose = dream.purpose;
         if (dream.dreamMVId == 0)
         {
             bool result = IBOVirtualAPI.CreateDreamMV(dreammv);
             dreammv = IBOVirtualAPI.GetDreamMV(ibo.IBONum);
         }
         else
         {
             dreammv.dreamMVId = dream.dreamMVId;
             string result = IBOVirtualAPI.UpdateDreamMV(dreammv.dreamMVId.ToString(), dreammv);
         }
         return(Json(new { success = true, id = dreammv.dreamMVId }));
     }
     catch
     {
         return(Json(new { success = false, id = 0 }));
     }
 }
コード例 #7
0
        public ActionResult EditGoal(int id)
        {
            ViewBag.tools  = new SelectList(tools, "toolId", "name");
            ViewBag.dreams = new SelectList(dreams, "dreamId", "dream1");
            Goal goal = IBOVirtualAPI.Get <Goal>(id.ToString());

            return(PartialView(goal));
        }
コード例 #8
0
        public ActionResult EditFollowup(int id)
        {
            ContactFollowup followup = IBOVirtualAPI.Get <ContactFollowup>(id.ToString());
            Contact         contact  = IBOVirtualAPI.Get <Contact>(followup.contactId.ToString());

            ViewBag.contactName = contact.GetFullName();
            return(PartialView(followup));
        }
コード例 #9
0
        public ActionResult EditContact(string id)
        {
            ViewBag.languages    = languages;
            ViewBag.contacttypes = contacttypes;
            Contact contact = IBOVirtualAPI.Get <Contact>(id);

            return(PartialView(contact));
        }
コード例 #10
0
 public ActionResult NewGoal(Goal model)
 {
     try
     {
         bool result = IBOVirtualAPI.Create <Goal>(model);
     }
     catch { }
     return(RedirectToAction("Index"));
 }
コード例 #11
0
 public ActionResult NewDream(Dream model)
 {
     try
     {
         bool result = IBOVirtualAPI.Create <Dream>(model);
     }
     catch { }
     return(RedirectToAction("Index"));
 }
コード例 #12
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 }));
        }
コード例 #13
0
        public ActionResult Index()
        {
            /* Get Clients For Autocomplete */
            _contacts = null;
            _contacts = GetContacts();
            List <FollowupView> followups = IBOVirtualAPI.GetIBOFollowupView(ibo.IBONum);

            return(View(followups));
        }
コード例 #14
0
        public ActionResult Index()
        {
            List <Book> Books  = IBOVirtualAPI.GetIBOBooks(ibo.IBONum);
            List <Book> CBooks = IBOVirtualAPI.GetMyBooks(ibo.IBONum);

            ViewBag.ibolevel  = ibo.level;
            ViewBag.BookCount = CBooks.Count;
            return(View(Books));
        }
コード例 #15
0
        public ActionResult CreateBook()
        {
            List <Book> BookList = IBOVirtualAPI.GetBooks();

            ViewBag.BookList = BookList;
            Book Book = new Book();

            Book.IBONum = ibo.IBONum;
            return(PartialView(Book));
        }
コード例 #16
0
        public ActionResult CreateAlert()
        {
            List <Alert> AlertList = IBOVirtualAPI.GetAllAlerts();

            ViewBag.AlertList = AlertList;
            Alert Alert = new Alert();

            Alert.datetime = DateTime.Now;
            return(PartialView(Alert));
        }
コード例 #17
0
        public ActionResult CreateTicket()
        {
            List <PriorityLevel> priorityLevel = IBOVirtualAPI.GetPriorityLevels();

            ViewBag.PriorityLevel = new SelectList(priorityLevel, "ID", "Name");
            Ticket ticket = new Ticket();

            ticket.email = ibo.email;
            return(PartialView(ticket));
        }
コード例 #18
0
 public ActionResult DeleteFollowupAjax(int id)
 {
     try
     {
         string result = IBOVirtualAPI.Delete <ContactFollowup>(id.ToString());
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false }));
     }
 }
コード例 #19
0
 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 }));
     }
 }
コード例 #20
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 }));
     }
 }
コード例 #21
0
 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 }));
     }
 }
コード例 #22
0
 public ActionResult DeleteContactAjax(string id)
 {
     try
     {
         string result = IBOVirtualAPI.Delete <Contact>(id);
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false, message = "There was an issue with the server, please try again latter." }));
     }
 }
コード例 #23
0
 public ActionResult DeleteBookAjax(string id)
 {
     try
     {
         string result = IBOVirtualAPI.Delete <Book>(id);
         return(Json(new { success = true }));
     }
     catch
     {
         return(Json(new { success = false }));
     }
 }
コード例 #24
0
        public decimal GetProgress(string id)
        {
            GoalProgress Goalprogress = IBOVirtualAPI.GetProgress(id);

            try
            {
                return(Goalprogress.progress);
            }
            catch
            {
                return(0);
            }
        }
コード例 #25
0
 public ActionResult MoreDreams(int id)
 {
     try
     {
         Dream dream = IBOVirtualAPI.Get <Dream>(id.ToString());
         if (dream != null)
         {
             Dream newDream = ModelParser.ParseDream(dream);
             bool  result   = IBOVirtualAPI.Create <Dream>(newDream);
         }
     }
     catch { }
     return(RedirectToAction("Index"));
 }
コード例 #26
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 }));
     }
 }
コード例 #27
0
 public ActionResult MoreGoals(int id)
 {
     try
     {
         Goal goal = IBOVirtualAPI.Get <Goal>(id.ToString());
         if (goal != null)
         {
             Goal newGoal = ModelParser.ParseGoal(goal);
             bool result  = IBOVirtualAPI.Create <Goal>(newGoal);
         }
     }
     catch { }
     return(RedirectToAction("Index"));
 }
コード例 #28
0
        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"));
        }
コード例 #29
0
 public ActionResult CreateBookAjax(Book model)
 {
     if (ModelState.IsValid == true)
     {
         bool result = IBOVirtualAPI.Create <Book>(model);
         if (result)
         {
             return(Json(model));
         }
         else
         {
             return(Json(new { success = false }));
         }
     }
     else
     {
         return(Json(new { success = false }));
     }
 }
コード例 #30
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." }));
     }
 }