public ActionResult cheer(long planId)
        {
            IQueryable <Plan> plan = _planService.getPlanById(planId);

            plan.ToList()[0].planComeOnNum = plan.ToList()[0].planComeOnNum + 1;
            bool boo_plan = _planService.updatePlan(plan.FirstOrDefault());

            PlanComeOn planComeOn = new PlanComeOn();

            planComeOn.planId         = planId;
            planComeOn.planComeOnTime = DateTime.Now;
            planComeOn.userId         = loginUser.userId;
            bool boo_comeOn = _planComeOnService.addPlanComeOn(planComeOn);

            if (boo_plan == true && boo_comeOn == true)
            {
                JsonResult["boo_success"] = true;
                return(Json(JsonResult));
            }
            else
            {
                JsonResult["boo_success"] = false;
                return(Json(JsonResult));
            }
        }
Esempio n. 2
0
 public bool upatePlanComeOn(PlanComeOn planComeOn)
 {
     try
     {
         _planComeOnRepository.Update(planComeOn);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 3
0
 public bool addPlanComeOn(PlanComeOn planComeOn)
 {
     try
     {
         _planComeOnRepository.Add(planComeOn);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        public ActionResult checkIfCheered(long planId)
        {
            PlanComeOn planComeOn = _planComeOnService.getPlanComeOnByPlanidUserid(planId, loginUser.userId);

            if (planComeOn == null)
            {
                JsonResult["boo_success"] = true;
                return(Json(JsonResult));
            }
            else
            {
                JsonResult["boo_success"] = false;
                return(Json(JsonResult));
            }
        }
        public ActionResult updatePlanComeOn(string planComeOnWrite, long planId)
        {
            PlanComeOn planComeOn = _planComeOnService.getPlanComeOnByPlanidUserid(planId, loginUser.userId);

            planComeOn.planComeOnWrite = planComeOnWrite;
            if (_planComeOnService.upatePlanComeOn(planComeOn))
            {
                JsonResult["boo_success"] = true;
                return(Json(JsonResult));
            }
            else
            {
                JsonResult["boo_success"] = false;
                return(Json(JsonResult));
            }
        }