コード例 #1
0
    protected static void SaveDraft(string ChaptId, string Content, string chapName)
    {
        try
        {
            // if (IsNameChanged)
            // {
            ChapterVersion cv = DocoManager.GetAllChapterVersion().Where(x => x.Id.Equals(ChaptId)).First <ChapterVersion>();

            if (chapName != cv.Name)
            {
                cv.Name = chapName;
                DocoManager.UpdateChapterVersion(cv);
            }
            //   IsNameChanged = false;
            //  }
            Draft draft = new Draft();
            draft.VersionId = ChaptId;
            draft.Content   = Content;
            draft.SaveDate  = DateTime.Now;
            draft           = BusiBlocks.DocoBlock.DocoManager.UpsertDraft(draft);
            //divDraftsList.InnerHtml = BindDrafts(ChaptId);
        }
        catch (Exception ex)
        {
            //Log - unable to save current draft.
            throw ex;
        }
    }
コード例 #2
0
    protected Draft SaveDraft(string ChaptId, string Content)
    {
        try
        {
            //if (IsNameChanged)
            // {
            ChapterVersion cv = DocoManager.GetAllChapterVersion().Where(x => x.Id.Equals(ChaptId)).First <ChapterVersion>();

            if (txtBoxChapterName.Text != cv.Name)
            {
                cv.Name = txtBoxChapterName.Text;
                DocoManager.UpdateChapterVersion(cv);
            }
            //IsNameChanged = false;
            //}
            Draft draft = new Draft();
            draft.VersionId = ChaptId;
            draft.Content   = Content;
            draft.SaveDate  = DateTime.Now;
            draft           = BusiBlocks.DocoBlock.DocoManager.UpsertDraft(draft);
            //divDraftsList.InnerHtml = BindDrafts(ChaptId);

            //Reconstruct Menu;
            CreateSubChapterMenu(Content);
            return(draft);
        }
        catch (Exception ex)
        {
            //Log - unable to save current draft.
            throw ex;
        }
    }
コード例 #3
0
    public string ChangeChapterName(string chaptId, string chapName)
    {
        var cv = DocoManager.GetAllChapterVersion().Where(x => x.Id.Equals(chaptId)).First <ChapterVersion>();

        if (chapName != cv.Name)
        {
            cv.Name = chapName;
            DocoManager.UpdateChapterVersion(cv);
        }
        return(cv.Name);
    }
コード例 #4
0
    public bool Save(string chaptId, string content, string chapName)
    {
        var cv = DocoManager.GetAllChapterVersion().Where(x => x.Id.Equals(chaptId)).First <ChapterVersion>();

        if (chapName != cv.Name)
        {
            cv.Name = chapName;
            DocoManager.UpdateChapterVersion(cv);
        }
        var draft = new Draft();

        draft.VersionId = chaptId;
        draft.Content   = content;
        draft.SaveDate  = DateTime.Now;
        DocoManager.UpsertDraft(draft);

        return(true);
    }