public FenCarriere(MdiContainer mct, Employe emp, CarriereMotif motif) { InitializeComponent(); sess_emp = new SessionEmploye(); sess_car = new SessionCarriere(); mdiContainer = mct; code_emp = emp.CodeEmploye; this.VerifierStatutEmploye(emp); this.InitialiserCbo(); this.PreparerInfo(emp, motif); this.RemplirEmploye(emp, motif); }
private void VerifierStatutEmploye(Employe emp, CarriereMotif cm) { if (emp.EstRevoque()) { this.lblFailure.Text = "L'Employé " + emp.Nom + " " + emp.Prenom + " est revoqué!"; } else { this.InitialiserDDL(); this.PreparerInfo(emp, cm); this.RemplirEmploye(emp, cm); } }
private void PreparerInfo(Employe emp, CarriereMotif motif) { StatutCarriere stc; switch (motif) { case CarriereMotif.Promotion: this.operation_title.InnerText = "Donner une Promotion"; this.ddlMotifStatut.SelectedValue = "Promotion"; this.ddlMotifStatut.Enabled = false; this.btnValiderPromotion.Style.Add("display", "block"); break; case CarriereMotif.Transfert: this.operation_title.InnerText = "Effectuer un Transfert"; stc = emp.getStatutActuel(); this.ddlMotifStatut.SelectedValue = "Transfert"; this.ddlMotifStatut.Enabled = false; //Garde le meme Grade this.ddlGrade.SelectedValue = stc.CodeGrade.ToString(); this.ddlGrade.Enabled = false; //Garde le meme Poste this.ddlPoste.SelectedValue = stc.CodePoste.ToString(); this.ddlPoste.Enabled = false; this.btnValiderTransfert.Style.Add("display", "block");; break; case CarriereMotif.Revocation: this.operation_title.InnerText = "Effectuer une Revocation"; stc = emp.getStatutActuel(); this.ddlDepartement.Visible = false; this.ddlMotifStatut.Visible = false; this.ddlGrade.Visible = false; this.ddlPoste.Visible = false; this.tbDebutStatut.Visible = false; this.revocation_input.Style.Add("display", "block"); this.btnValiderRevocation.Style.Add("display", "block"); break; } }
private void RemplirEmploye(Employe emp, CarriereMotif motif) { this.lbEspaceEmploye.Content = motif + " de l'Employé : (" + emp.CodeEmploye + ") " + emp.Prenom + " " + emp.Nom; try { StatutCarriere stc = emp.getStatutActuel(); this.lbDepartement.Content = stc.getDepartement().Name; this.lbGrade.Content = stc.getGrade().Name; this.lbPoste.Content = stc.getPoste().Name; this.lbDebut.Content = stc.Debut; this.lbMotif.Content = stc.Motif; this.dgCarriere.ItemsSource = emp.getStatutCarrieres(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void RemplirEmploye(Employe emp, CarriereMotif motif) { this.lbEspaceEmploye.Text = motif + " de l'Employé : (" + emp.CodeEmploye + ") " + emp.Prenom + " " + emp.Nom; try { StatutCarriere stc = emp.getStatutActuel(); this.lbDepartement.Text = stc.getDepartement().Name; this.lbGrade.Text = stc.getGrade().Name; this.lbPoste.Text = stc.getPoste().Name; this.lbDebut.Text = stc.Debut.ToString(); this.lbMotif.Text = stc.Motif; this.dgCarriere.DataSource = emp.getStatutCarrieres(); this.dgCarriere.DataBind(); } catch (Exception ex) { this.lblFailure.Text = ex.Message; } }
private void PreparerInfo(Employe emp, CarriereMotif motif) { switch (motif) { case CarriereMotif.Promotion: this.cboMotifStatut.SelectedValue = "Promotion"; this.cboMotifStatut.IsEnabled = false; this.btnValiderPromotion.Visibility = Visibility.Visible; break; case CarriereMotif.Transfert: StatutCarriere stc = emp.getStatutActuel(); this.cboMotifStatut.SelectedValue = "Transfert"; this.cboMotifStatut.IsEnabled = false; //Garde le meme Grade this.cboGrade.SelectedValue = stc.CodeGrade; this.cboGrade.IsEnabled = false; //Garde le meme Poste this.cboPoste.SelectedValue = stc.CodePoste; this.cboPoste.IsEnabled = false; this.btnValiderTransfert.Visibility = Visibility.Visible; break; case CarriereMotif.Revocation: this.lbFinStatut.Visibility = Visibility.Visible; this.dpFinStatut.Visibility = Visibility.Visible; this.cboDepartement.IsEnabled = false; this.cboGrade.IsEnabled = false; this.cboPoste.IsEnabled = false; this.dpDebutStatut.IsEnabled = false; this.cboMotifStatut.IsEnabled = false; this.btnValiderRevocation.Visibility = Visibility.Visible; break; } }
protected void Page_Load(object sender, EventArgs e) { sess_emp = new SessionEmploye(); sess_car = new SessionCarriere(); this.lblFailure.Text = null; this.lblSuccess.Text = null; if (Request.QueryString["emp"] != null) { string code = Request.QueryString["emp"]; if (Request.QueryString["op"] == "promotion" | Request.QueryString["op"] == "transfert" | Request.QueryString["op"] == "revocation") { string operation = Request.QueryString["op"]; CarriereMotif cm = new CarriereMotif(); if (operation == "promotion") { cm = CarriereMotif.Promotion; } if (operation == "transfert") { cm = CarriereMotif.Transfert; } if (operation == "revocation") { cm = CarriereMotif.Revocation; } try { SessionEmploye sess_emp_emp = new SessionEmploye(); Employe emp = sess_emp_emp.EmployePourModification(code); code_employe = emp.CodeEmploye; this.SetLeftMenu(emp); //If the Page loaded for the first time if (!Page.IsPostBack) { this.VerifierStatutEmploye(emp, cm); } } catch (Exception ex) { this.lblFailure.Text = "Employé non trouvé! " + ex.Message; this.content_menu.Style.Add("display", "none"); } } else { this.lblFailure.Text = "Opération inconnue!"; this.content_menu.Style.Add("display", "none"); } } else { this.lblFailure.Text = "Aucun Employé à Gérer!"; this.content_menu.Style.Add("display", "none"); } }