Exemplo n.º 1
0
        public FenConge(MdiContainer mct, Employe emp, string operation)
        {
            InitializeComponent();
            sess_cong    = new SessionConge();
            mdiContainer = mct;
            code_employe = emp.CodeEmploye;

            this.VerifierStatutEmploye(emp);
            this.InitialiserCbo();
            this.PreparerInfo(emp, operation);
            this.RemplirEmploye(emp, operation);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            sess_cong = new SessionConge();

            this.lblFailure.Text = null;
            this.lblSuccess.Text = null;

            if (Request.QueryString["emp"] != null)
            {
                string code = Request.QueryString["emp"];

                if (Request.QueryString["op"] == "demande"
                    | Request.QueryString["op"] == "retour")
                {
                    string operation = Request.QueryString["op"];

                    try
                    {
                        SessionEmploye sess_cong_emp = new SessionEmploye();
                        Employe        emp           = sess_cong_emp.EmployePourModification(code);
                        code_employe = emp.CodeEmploye;

                        this.SetLeftMenu(emp);

                        //If the Page loaded for the first time
                        if (!Page.IsPostBack)
                        {
                            this.VerifierStatutEmploye(emp, operation);
                        }
                    }
                    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");
            }
        }