コード例 #1
0
ファイル: NoteApi.cs プロジェクト: xxy1991/cozy
        public static bool NoteCreate(int notebookid, string notebookpass, string notename, int type, string notedate, ref int noteid)
        {
            var input = new NoteCreateInput()
            {
                NotebookId      = notebookid,
                NotebookPass    = notebookpass,
                NoteName        = notename,
                NoteType        = type,
                NoteData        = notedate,
            };
            var json    = JsonConvert.SerializeObject(input);

            string output = null;
            try
            {
                output = HttpReader.HttpPost(ApiDef.NoteCreate, json);
            }
            catch (AggregateException)
            {
                return false;
            }

            var result      = JsonConvert.DeserializeObject<NoteCreateOutput>(output);
            var issuccess   = ResultStatus.IsSuccess(result.ResultStatus);
            if (issuccess)
            {
                noteid = result.NoteId;
            }
            return issuccess;
        }
コード例 #2
0
ファイル: Program.Methods.cs プロジェクト: jun-quan-Lai/cozy
 public static int CreateNote(int notebookid, string notebookpass, string notename, int type, string notedate)
 {
     var notecreateinput = new NoteCreateInput()
     {
         NotebookId      = notebookid,
         NotebookPass    = notebookpass,
         NoteName        = notename,
         NoteType        = type,
         NoteData        = notedate,
     };
     var output              = notemodule.OnNoteCreate(JsonConvert.SerializeObject(notecreateinput));
     var usercreateoutput    = JsonConvert.DeserializeObject<NoteCreateOutput>(output);
     return usercreateoutput.NoteId;
 }