Exemplo n.º 1
0
        private void LoadData()
        {
            List <Question> list = logic.Read(null);

            if (list != null)
            {
                dataGridView1.DataSource = list;
                dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
        }
Exemplo n.º 2
0
 private void QuestAdd_Load(object sender, EventArgs e)
 {
     if (id.HasValue)
     {
         try
         {
             var view = questionLogic.Read(new QuestionBindModel {
                 Id = id
             })?[0];
             if (view != null)
             {
                 textBoxName.Text = view.quest;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
         }
     }
 }