public JsonResult SaveLearnPlan(string data)
        {
            try
            {
                LenLearnPlan lenLearnPlan = Newtonsoft.Json.JsonConvert.DeserializeObject <LenLearnPlan>(data);
                if (lenLearnPlan.PlanId == 0)
                {
                    lenLearnPlan.LastUpdateTime = DateTime.Now;
                    lenLearnPlan.CreateTime     = DateTime.Now;
                    lenLearnPlan.CreateUser     = CurrentUser.UserId;
                    lenLearnPlan.PublishStatus  = 0;
                    lenLearnPlan.Status         = 0;
                    _learnPlan.Add(lenLearnPlan);
                }
                else
                {
                    lenLearnPlan.LastUpdateTime = DateTime.Now;
                    var model = _learnPlan.GetModel(lenLearnPlan.PlanId);
                    model.Description = lenLearnPlan.Description;
                    model.FrontImage  = lenLearnPlan.FrontImage;
                    model.IsOpen      = lenLearnPlan.IsOpen;
                    model.PlanName    = lenLearnPlan.PlanName;
                    model.PlanType    = lenLearnPlan.PlanType;
                    _learnPlan.Update(model);
                }

                return(Json(new { result = 1, content = lenLearnPlan.PlanId }, JsonRequestBehavior.DenyGet));
            }
            catch (Exception)
            {
                return(Json(new { result = 0, content = RetechWing.LanguageResources.Common.SaveFailed }, JsonRequestBehavior.DenyGet));
            }
        }
Example #2
0
 public int Update(LenLearnPlan model)
 {
     return(_dataAccess.UpdateEntity(model));
 }
Example #3
0
 public int Add(LenLearnPlan model)
 {
     return(_dataAccess.AddEntity(model));
 }
        public ActionResult EditLearnPlan(int planId = 0)
        {
            LenLearnPlan lenLearnPlan = _learnPlan.GetModel(planId) ?? new LenLearnPlan();

            return(View(lenLearnPlan));
        }