Ejemplo n.º 1
0
        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
        }
Ejemplo n.º 2
0
        public void CreateNotebook()
        {
            Notebook newNotebook = new Notebook()
            {
                Name = "New notebook"
            };

            DatabaseHelper.Insert(newNotebook);
        }
Ejemplo n.º 3
0
        public void CreateNotebook()
        {
            Notebook newNote = new Notebook()
            {
                Name   = "New notebook",
                UserId = int.Parse(App.Userid)
            };

            DatabaseHelper.Insert(newNote);
            ReadNotebooks();
        }
Ejemplo n.º 4
0
        public void CreateNotebook()
        {
            Notebook newNotebook = new Notebook()
            {
                Name   = "New notebook",
                UserId = App.UserId
            };

            DatabaseHelper.Insert(newNotebook);
            ReadNotebooks();
        }
Ejemplo n.º 5
0
        public void CreateNote(int notebookId)
        {
            Note newNote = new Note()
            {
                NotebookId  = notebookId,
                CreatedTime = DateTime.Now,
                UpdatedTime = DateTime.Now,
                Title       = "New note"
            };

            DatabaseHelper.Insert(newNote);
        }
Ejemplo n.º 6
0
 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();
         }
     }
 }
Ejemplo n.º 7
0
 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());
         }
     }
 }
Ejemplo n.º 8
0
 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());
         }
     }
 }
Ejemplo n.º 9
0
        public void CreateNotebook()
        {
            Notebook newNotebook = new Notebook()
            {
                Name      = "New Notebook",
                UserId    = int.Parse(App.UserId),
                IsEditing = true
            };

            DatabaseHelper.Insert <Notebook>(newNotebook);

            ReadNotebooks();
        }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
        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
                }
            }
        }
Ejemplo n.º 12
0
        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());
                }
            }
        }
Ejemplo n.º 13
0
        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();
        }
Ejemplo n.º 14
0
        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();
        }
Ejemplo n.º 15
0
        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();
        }
Ejemplo n.º 16
0
        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();
        }
Ejemplo n.º 17
0
        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());
            }
        }
Ejemplo n.º 18
0
        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();
        }
Ejemplo n.º 19
0
        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());
            }
        }
Ejemplo n.º 20
0
        // 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();
        }