Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //stocker l'id de l'utilisateur connecté
     IdUser = employeRep.GetByLogin(Session["user"].ToString());
     if (!IsPostBack)
     {
         string connetionString = ConfigurationManager.ConnectionStrings["PPPConnectionString"].ConnectionString;
         //charger les demandes de conges correspondantes à ce user
         BindGrid();
         //Specify the connectionString , insert, select cmd of the formView
         SqlDSForm.SelectCommand    = demandeCongeRep.Select();
         SqlDSForm.ConnectionString = connetionString;
         //configuration de la liste des types de conges
         SqlDSList.ConnectionString = connetionString;
         SqlDSList.SelectCommand    = congeRep.Select();
         //config de la list des colonnes de la gridView pour le filtrage
         SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM INFORMATION_SCHEMA.columns as name where table_name = 'DemandeConges'", connetionString);
         DataTable      dt = new DataTable();
         da.Fill(dt);
         DropDownListColumn.DataSource     = dt;
         DropDownListColumn.DataValueField = "COLUMN_NAME";
         DropDownListColumn.DataTextField  = "COLUMN_NAME";
         DropDownListColumn.DataBind();
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string employeId = Request.QueryString["Id"];

            //stocker l'id de l'utilisateur connecté
            IdUser = employeRepository.GetByLogin(Session["user"].ToString());
            Employe employe = this.employeRepository.GetById(Convert.ToInt32(employeId));

            connetionString = ConfigurationManager.ConnectionStrings["PPPConnectionString"].ConnectionString;

            if (employe == null)
            {
                Response.Redirect("~/GestionSalaire.aspx");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    FillData(employe);
                }
            }
        }