예제 #1
0
        public frmGreen()
        {
            InitializeComponent();
            _RegionNew  = _DefaultRegion;
            _ContratNew = _DefaultContrat;
            _PosteNew   = _DefaultPoste;
            _SocieteNew = _DefaultSociete;

            _SocieteManager = new SocieteManager();
            _RegionManager  = new RegionManager();
            _PosteManager   = new PosteManager();
            _ContratManager = new ContratManager();

            this.DialogResult = DialogResult.Cancel;
            _NewOffre         = new Offre();

            this.FillingAllComboBox();

            this.FillFormulaire();

            buttonInsert.Visible = this.EnabledInsertion();

            labelTitre.Text       = "Création d'une nouvelle Offre";
            labelInsert.Text      = "Veuillez remplir les champs obligatoires";
            labelInsert.ForeColor = Color.DarkRed;
        }
예제 #2
0
        public frmYellow(Offre offre)
        {
            InitializeComponent();

            _RegionManager  = new RegionManager();
            _PosteManager   = new PosteManager();
            _ContratManager = new ContratManager();

            _OldOffre = offre;
            _NewOffre = offre;

            this.DialogResult = DialogResult.Cancel;

            this.FillFormulaire(_OldOffre);

            this.FillingAllComboBox();

            buttonUpdate.Enabled = EnabledUpdate();

            regionNew  = _DefaultRegion;
            contratNew = _DefaultContrat;
            posteNew   = _DefaultPoste;

            labelTitre.Text    = $"Modification de l'offre N°{_OldOffre.Id}";
            labelResultat.Text = String.Empty;
        }
예제 #3
0
 private void bindingSourceRegion_CurrentChanged(object sender, EventArgs e)
 {
     if (bindingSourceRegion.Current != null && regionNew != null)
     {
         regionNew            = new BO.Region((Consultation)bindingSourceRegion.Current);
         labelRegionNew.Text  = (regionNew.Id != 0)?regionNew.Nom : _OldOffre.MySelection.MyRegion.Nom;
         buttonUpdate.Enabled = EnabledUpdate();
         labelResultat.Text   = String.Empty;
     }
 }
예제 #4
0
 private void bindingSourceRegion_CurrentItemChanged(object sender, EventArgs e)
 {
     if (bindingSourceRegion.Current != null && _RecordedSelection != null)
     {
         _RecordedRegion            = new BO.Region((Consultation)bindingSourceRegion.Current);
         _RecordedSelection         = new Selection(_RecordedSociete, _RecordedPoste, _RecordedRegion, _RecordedContrat, _RecordedJour);
         labelPreferenceRegion.Text = _RecordedSelection.MyRegion.Nom;
         this.FillingDataGridView(_RecordedSelection);
     }
 }
예제 #5
0
        private void bindingSourceRegion_CurrentItemChanged(object sender, EventArgs e)
        {
            if (bindingSourceRegion.Current != null && _RegionNew != null)
            {
                _RegionNew = new BO.Region((Consultation)bindingSourceRegion.Current);

                labelRegion.Text = (_RegionNew.Id != 0)?_RegionNew.Nom : String.Empty;
                _NewOffre.MySelection.MyRegion = (_RegionNew.Id != 0) ? _RegionNew : null;
                panelRegion.BackColor          = (_RegionNew.Id != 0) ? _ColorFonce : _ColorEmpty;
                labelRegion.ForeColor          = (_RegionNew.Id != 0) ? _ColorClair : _ColorEmpty;
                buttonInsert.Visible           = EnabledInsertion();
            }
        }
예제 #6
0
        /// <summary>
        /// Gestion du bouton Modification de l'offre
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonModifier_Click(object sender, EventArgs e)
        {
            if (mode == EModeDetailsOffre.READ_ONLY)
            {
                OpenPopup(Offre);
            }
            else
            {
                if (MessageBox.Show(Properties.Resources.MsgModif,
                                    Properties.Resources.MsgTitre,
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Warning,
                                    MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    if (true)
                    {
                        int?      id          = Offre.Id;
                        string    titre       = ((TextBox)formControls["Titre"]).Text;
                        string    description = ((TextBox)formControls["Description"]).Text;
                        Poste     poste       = (Poste)((ComboBox)formControls["Type de Poste"]).SelectedItem;
                        Contrat   contrat     = (Contrat)((ComboBox)formControls["Type de Contrat"]).SelectedItem;
                        BO.Region region      = (BO.Region)((ComboBox)formControls["Région"]).SelectedItem;
                        DateTime  creation    = (DateTime)((DateTimePicker)formControls["Date Publication"]).Value;
                        string    lien        = ((TextBox)formControls["Lien"]).Text;

                        Offre offre  = new Offre(id, poste, contrat, region, titre, description, creation, lien);
                        int   result = controller.UpdateOffre(offre);

                        if (result == 1)
                        {
                            MessageBox.Show($"{result} offre a été modifiéé");
                        }
                        else
                        {
                            MessageBox.Show("Aucune offre n'a été modifiée");
                        }
                        this.ParentForm.Close();
                    }
                }
            }
        }
예제 #7
0
        public frmGrey() : base()
        {
            InitializeComponent();

            _RecordedSociete = new Societe(_DefaultSociete);
            _RecordedRegion  = new BO.Region(_DefaultRegion);
            _RecordedContrat = new Contrat(_DefaultContrat);
            _RecordedPoste   = new Poste(_DefaultPoste);
            _RecordedJour    = new Jour(_DefaultJour);

            _RecordedOffre = new Offre();

            this.FillingAllComboBox();

            _RecordedSelection = new Selection(_RecordedSociete, _RecordedPoste, _RecordedRegion, _RecordedContrat, _RecordedJour);

            this.FillingDataGridView(_RecordedSelection);

            this.HideButtonPreference();
            labelAction.Text = String.Empty;

            panelPreference.Visible = false;
        }