Ejemplo n.º 1
0
        private void ViewNote_Load(object sender, EventArgs e)
        {
            NoteModel nm = DBCalls.retrieveSingleNoteInfo(Id);

            tbTitle.Text   = nm.Title;
            tbContent.Text = nm.Content;
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int numberOfNotes = DBCalls.countNoOfNotes();

            Console.Write(numberOfNotes);
            if (String.IsNullOrEmpty(Convert.ToString(numberOfNotes)) || String.IsNullOrWhiteSpace(Convert.ToString(numberOfNotes)))
            {
                numberOfNotes = 0;
            }
            DBCalls.createNote(numberOfNotes, tbTitle.Text, tbContent.Text);
        }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();

                dt.Columns.Add("Id", typeof(int));
                dt.Columns.Add("Title", typeof(String));
                dt.Columns.Add("Content", typeof(String));

                List <NoteModel> nmList = DBCalls.retrieveAllNoteInfo();
                foreach (NoteModel nm in nmList)
                {
                    dt.Rows.Add(nm.Id, nm.Title, nm.Content);
                }

                dataGridView1.DataSource = dt;
            }catch (Exception err)
            {
                Console.WriteLine(err);
            }
        }
Ejemplo n.º 4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     DBCalls.UpdateNote(getId(), tbTitle.Text, tbContent.Text);
 }