public async void Register() { #if USEAZURE try { await App.MobileServiceClient.GetTable <Users>().InsertAsync(User); App.UserId = User.Id.ToString(); HasLoggedIn(this, new EventArgs()); } catch (Exception ex) { } #else using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { conn.CreateTable <Users>(); var result = DatabaseHelper.Insert(User); if (result) { App.UserId = user.Id.ToString(); HasLoggedIn(this, new EventArgs()); } } #endif }
public void CreateNotebook() { Notebook newNotebook = new Notebook() { Name = "New notebook" }; DatabaseHelper.Insert(newNotebook); }
public void CreateNotebook() { Notebook newNote = new Notebook() { Name = "New notebook", UserId = int.Parse(App.Userid) }; DatabaseHelper.Insert(newNote); ReadNotebooks(); }
public void CreateNotebook() { Notebook newNotebook = new Notebook() { Name = "New notebook", UserId = App.UserId }; DatabaseHelper.Insert(newNotebook); ReadNotebooks(); }
public void CreateNote(int notebookId) { Note newNote = new Note() { NotebookId = notebookId, CreatedTime = DateTime.Now, UpdatedTime = DateTime.Now, Title = "New note" }; DatabaseHelper.Insert(newNote); }
public void Register() { using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { conn.CreateTable <User>(); var result = DatabaseHelper.Insert <User>(User); if (result) { App.UserId = user.Id.ToString(); } } }
public void Register() { using (SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { connection.CreateTable <User>(); bool succesfullInsertion = DatabaseHelper.Insert(User); if (succesfullInsertion) { App.UserId = User.Id.ToString(); HasLoggedIn(this, new EventArgs()); } } }
public void Register() { using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { conn.CreateTable <User>(); var result = DatabaseHelper.Insert(User); if (result) { App.Userid = user.Id.ToString(); HasLoginedIn(this, new EventArgs()); } } }
public void CreateNotebook() { Notebook newNotebook = new Notebook() { Name = "New Notebook", UserId = int.Parse(App.UserId), IsEditing = true }; DatabaseHelper.Insert <Notebook>(newNotebook); ReadNotebooks(); }
public async void CreateNote(string notebookId) { Note newNote = new Note() { NotebookId = notebookId, CreatedTime = DateTime.Now, UpdatedTime = DateTime.Now, Title = "New note" }; await DatabaseHelper.Insert(newNote); ReadNotes(); }
public void Register() { using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) { conn.CreateTable <User>(); var result = DatabaseHelper.Insert <User>(User); if (result) { //TODO: Register functionality } } }
public void Register() { using (SQLiteConnection conn = new SQLiteConnection(DatabaseHelper.dbFile)) { conn.CreateTable <User>(); var isInserted = DatabaseHelper.Insert(User); if (isInserted) { App.UserId = User.Id.ToString(); HasLoggedIn(this, new EventArgs()); } } }
public void CreateNotebook()//int userId) { int userId; int.TryParse(App.UserId, out userId); var newNotebook = new Notebook() { Name = "New notebook", UserId = userId }; DatabaseHelper.Insert(newNotebook); ReadNotebooks(); }
public void CreateNotebook(User user) { //TODO: Implement name - explore using Popup instead of VB extension var name = Microsoft.VisualBasic.Interaction.InputBox("Please Enter Notebook Title", "Create New Notebook", "Notebook"); Notebook notebook = new Notebook() { UserId = user.Id, Name = name }; DatabaseHelper.Insert(notebook); ReadNotebooks(); }
public void CreateNote(int notebookId) { var title = Microsoft.VisualBasic.Interaction.InputBox("Please enter Note Title", "Create New Note", "New Note"); Note note = new Note() { NotebookId = notebookId, CreatedTime = DateTime.Now, UpdatedTime = DateTime.Now, Title = title }; DatabaseHelper.Insert(note); ReadNotes(); }
public void CreateNote(string notebookId) { Note newNote = new Note() { NotebookId = notebookId, CreatedTime = DateTime.Now, UdatedTime = DateTime.Now, Title = "New note" }; //DatabaseHelper.Insert<Note>(newNote); // is same as: DatabaseHelper.Insert(newNote); ReadNotes(); }
public async void Register() { //using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.GetFileLocation())) //{ // conn.CreateTable<User>(); // var result = DatabaseHelper.Insert(User); // if (result) // { // App.UserId = User.Id.ToString(); // HasLoggedIn(this, new EventArgs()); // } //} User = await DatabaseHelper.Insert(User); if (!string.IsNullOrEmpty(User.Id)) { App.UserId = User.Id; HasLoggedIn(this, new EventArgs()); } }
public async void CreateNotebook() { Notebook newNotebook = new Notebook() { Name = "New notebook", UserId = Int32.Parse(App.UserId) }; #if USEAZURE try { await App.MobileServiceClient.GetTable <Notebook>().InsertAsync(newNotebook); } catch (Exception ex) { } #else DatabaseHelper.Insert(newNotebook); #endif ReadNotebooks(); }
public async void Register() { //using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(DatabaseHelper.dbFile)) //{ // conn.CreateTable<User>(); // var result = DatabaseHelper.Insert(User); // if(result) // { // App.UserId = User.Id.ToString(); // HasLoggedIn(this, new EventArgs()); // } //} var result = await DatabaseHelper.Insert(User); if (result) { App.UserId = User.Id.ToString(); HasLoggedIn(this, new EventArgs()); } }
// Note for Azure Port: parameter notebookId must be a string public async void CreateNote(int notebookId) { Note newNote = new Note() { NotebookId = notebookId, CreatedTime = DateTime.Now, UpdatedTime = DateTime.Now, Title = "New note" }; #if USEAZURE try { await App.MobileServiceClient.GetTable <Note>().InsertAsync(newNote); } catch (Exception ex) { } #else DatabaseHelper.Insert(newNote); #endif ReadNotes(); }