示例#1
0
        private void btModifSujet_Click_1(object sender, EventArgs e)
        {
            using (FormSujet formModifSujet = new FormSujet())
            {
                formModifSujet.modif    = true;
                formModifSujet.rubrique = (Rubrique)comboBoxRub.SelectedItem;
                formModifSujet.sujet    = (Sujet)comboBoxSujet.SelectedItem;

                formModifSujet.Text = string.Format("Modifier le sujet {0} dans la rubrique {1}", formModifSujet.sujet.TextSujet, formModifSujet.rubrique.NomRub);

                formModifSujet.ShowDialog();
            }
            List <Sujet> sujets = BLL.ListSujetsByIdRub((int)comboBoxRub.SelectedValue);

            comboBoxSujet.DataSource = sujets;
            if (bindingSourceRep.Count != 0)
            {
                dgvReponse.DataSource = bindingSourceRep;
                dgvReponse.Columns["IDREP"].Visible   = false;
                dgvReponse.Columns["IDSUJET"].Visible = false;
                dgvReponse.Columns["IDUSER"].Visible  = false;

                dgvReponse.Columns["TEXTREP"].HeaderText      = "Texte";
                dgvReponse.Columns["DATEENVOIREP"].HeaderText = "Date d'envoi";
            }
        }
示例#2
0
        private void btAjoutSujet_Click(object sender, EventArgs e)
        {
            using (FormSujet formSujet = new FormSujet())
            {
                formSujet.modif    = false;
                formSujet.rubrique = (Rubrique)comboBoxRub.SelectedItem;
                formSujet.Text     = string.Format("Ajouter un sujet dans la rubrique {0}", formSujet.rubrique.NomRub);
                formSujet.ShowDialog();

                comboBoxSujet.DataSource = (BLL.ListSujetsByIdRub((int)comboBoxRub.SelectedValue));
            }
        }