public string OnNoteCreate(string args) { var Input = JsonConvert.DeserializeObject<NoteCreateInput>(args); var Result = new NoteCreateOutput(); var notebook = ModuleHelper.GetNotebook(Input.NotebookId, Input.NotebookPass); if(notebook != null) { var note = new Note() { notebook_id = notebook.id, name = Input.NoteName, type = Input.NoteType, data = Input.NoteData, }; var id = DbHolding.Note.Create(note); notebook.note_list.Add(id); DbHolding.Notebook.Update(notebook); Result.NoteId = id; Result.ResultStatus = ResultStatus.SuccessStatus; } var Output = JsonConvert.SerializeObject(Result); return Output; }
public static bool NoteGet(int notebookid, string notebookpass, int noteid, ref Note note) { var input = new NoteGetInput() { NotebookId = notebookid, NotebookPass = notebookpass, NoteId = noteid, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.NoteGet, json); var result = JsonConvert.DeserializeObject<NoteGetOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { note = result.Result; } return issuccess; }
public bool Update(Note obj) { return col.Update(obj.id, obj); }
public int Create(Note obj) { var r = col.Insert(obj); return r.AsInt32; }