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); }
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"); } }