Пример #1
0
        //编辑
        public ActionResult Edit()
        {
            Resume resume = ResumeDataSvc.GetByCondition(r => r.UserID == CurrentUser.ID).FirstOrDefault();

            ViewBag.Resume = resume;
            return(View());
        }
Пример #2
0
        public ActionResult EditSave(string md, string html, bool isPub)
        {
            Resume resume = ResumeDataSvc.GetByCondition(r => r.UserID == CurrentUser.ID).FirstOrDefault();

            if (resume == null)
            {
                resume        = new Resume();
                resume.UserID = CurrentUser.ID;
                resume.MD     = md;
                resume.Html   = HtmlST.Sanitize(html);
                resume.Public = isPub;
                ResumeDataSvc.Add(resume);
            }
            else
            {
                resume.MD     = md;
                resume.Html   = HtmlST.Sanitize(html);
                resume.Public = isPub;
                ResumeDataSvc.Update(resume);
            }
            return(Json(new { msg = "done", gid = CurrentUser.GitHubLogin }));
        }