Exemple #1
0
        private void ShowJournalbtn_Click(object sender, EventArgs e)
        {
            string jid = Journaltxt.Text;

            Journal j = AccountLayer.JournalPoster.GetJournalFromId(jid);

            if (j == null || j.rs.Count == 0)
            {
                MessageBox.Show("Journal doesnot exist");
                return;
            }

            DataTable dt = JournalPoster.JournalEntryToDataTable(j.rs);

            this.dataGridView1.DataSource = dt;
            dataGridView1.Refresh();
            dataGridView1.ReadOnly = true;
        }
        private void journalidtxt_Leave(object sender, EventArgs e)
        {
            string jid = journalidtxt.Text;

            if (!(JournalPoster.IsValidJournal(jid)))
            {
                MessageBox.Show("Invalid Journal");
                return;
            }
            Journal j = JournalPoster.GetJournalFromId(jid);

            dateTimePicker1.Text = j.jdate;
            NarrTxt.Text         = j.narration;
            DataTable dt = JournalPoster.JournalEntryToDataTable(j.rs);

            this.JournalGridView.DataSource = dt;
            this.JournalGridView.Refresh();
            this.JournalGridView.ReadOnly = true;
            PostBtn.Enabled = true;
        }