public static bool UserUpdate(string username, string userpass, string newname, string newpass) { var input = new UserUpdateInput() { UserName = username, UserPass = userpass, NewName = newname, NewPass = newpass, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.UserUpdate, json); } catch (System.AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <UserUpdateOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool UserCreate(string username, string pass, ref int userid) { var input = new UserCreateInput() { UserName = username, UserPass = pass, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.UserCreate, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <UserCreateOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { userid = result.UserId; } return(issuccess); }
public static bool UserNotebook(string username, string userpass, ref List <int> notebooklist) { var input = new UserNotebookInput() { UserName = username, UserPass = userpass, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.UserNotebook, json); } catch (System.AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <UserNotebookOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { notebooklist = result.NotebookList; } return(issuccess); }
public static bool NotebookList(int notebookid, string notebookpass, ref List <int> notelist) { var input = new NotebookListInput() { NotebookId = notebookid, NotebookPass = notebookpass, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.NotebookList, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <NotebookListOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { notelist = result.NoteList; } return(issuccess); }
public static bool NotebookUpdate(int notebookid, string notebookpass, string newname, string newpass) { var input = new NotebookUpdateInput() { NotebookId = notebookid, NotebookPass = notebookpass, NewName = newname, NewPass = newpass, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.NotebookUpdate, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <NotebookUpdateOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool NoteGet(int notebookid, string notebookpass, int noteid, ref Tuple <int, string, string> note) { var input = new NoteGetInput() { NotebookId = notebookid, NotebookPass = notebookpass, NoteId = noteid, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.NoteGet, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <NoteGetOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { note = Tuple.Create(result.Result.type, result.Result.name, result.Result.data); } return(issuccess); }
public static bool NotebookGet(int notebookid, ref Tuple <string, int> info) { var input = new NotebookGetInput() { NotebookId = notebookid, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.NotebookGet, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <NotebookGetOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { info = Tuple.Create(result.NotebookName, result.NoteSum); } return(issuccess); }
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); }
public static bool NoteMove(int fromid, string frompass, int toid, string topass, int noteid) { var input = new NoteMoveInput() { FromId = fromid, FromPass = frompass, ToId = toid, ToPass = topass, NoteId = noteid, }; var json = JsonConvert.SerializeObject(input); string output = null; try { output = HttpReader.HttpPost(ApiDef.NoteMove, json); } catch (AggregateException) { return(false); } var result = JsonConvert.DeserializeObject <NoteMoveOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool NotebookDelete(int notebookid, string notebookpass) { var input = new NotebookDeleteInput() { NotebookId = notebookid, NotebookPass = notebookpass, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.NotebookDelete, json); var result = JsonConvert.DeserializeObject <NotebookDeleteOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool UserUpdate(string username, string userpass, string newname, string newpass) { var input = new UserUpdateInput() { UserName = username, UserPass = userpass, NewName = newname, NewPass = newpass, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.UserUpdate, json); var result = JsonConvert.DeserializeObject <UserUpdateOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool NoteUpdate(int notebookid, string notebookpass, int noteid, string newname, int newtype, string newdate) { var input = new NoteUpdateInput() { NotebookId = notebookid, NotebookPass = notebookpass, NoteId = noteid, NewName = newname, NewType = newtype, NewData = newdate, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.NoteUpdate, json); var result = JsonConvert.DeserializeObject <NoteUpdateOutput>(output); return(ResultStatus.IsSuccess(result.ResultStatus)); }
public static bool NotebookGet(int notebookid, string notebookpass, ref Tuple <string, int> info) { var input = new NotebookGetInput() { NotebookId = notebookid, NotebookPass = notebookpass, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.NotebookGet, json); var result = JsonConvert.DeserializeObject <NotebookGetOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { info = Tuple.Create(result.NotebookName, result.NoteSum); } return(issuccess); }
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 static bool NotebookCreate(string username, string userpass, string notebookname, string notebookpass, ref int id) { var input = new NotebookCreateInput() { UserName = username, UserPass = userpass, NotebookName = notebookname, NotebookPass = notebookpass, }; var json = JsonConvert.SerializeObject(input); var output = HttpReader.HttpPost(ApiDef.NotebookCreate, json); var result = JsonConvert.DeserializeObject <NotebookCreateOutput>(output); var issuccess = ResultStatus.IsSuccess(result.ResultStatus); if (issuccess) { id = result.NotebookId; } return(issuccess); }