private void LBX_ImagesGUIDs_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (LBX_ImagesGUIDs.SelectedItem != null)
     {
         string GUID = LBX_ImagesGUIDs.SelectedItem.ToString();
         PBX_SelectedGUID.Image = DB_Images.Find(GUID);
     }
     else
     {
         PBX_SelectedGUID.BackgroundImage = null;
     }
 }
Exemple #2
0
        private void Check()
        {
            DLG_AjoutMonument dlg_modifier = new DLG_AjoutMonument(mDB_Images.Find(GetGUID(mNomMonument)));

            dlg_modifier.mPeuxModifier = true;
            dlg_modifier.mHistoire     = this.mHistoire;
            dlg_modifier.mNomMonument  = this.mNomMonument;
            dlg_modifier.mNBEtoiles    = this.mNbEtoiles;
            dlg_modifier.Date          = this.Date;
            dlg_modifier.mNomCircuit   = GetNomCircuitFromMonument(mNomMonument);

            if (dlg_modifier.ShowDialog() == DialogResult.OK)
            {
            }
        }
Exemple #3
0
 public AfficherImageMonument(string id, OracleConnection connection)
 {
     InitializeComponent();
     DB_Images = new DB_Images("Emile", "Salut123");
     try
     {
         string           sql          = "SELECT IMAGE FROM MONUMENTS WHERE IDMONUMENT = " + id;
         OracleCommand    cmd          = new OracleCommand(sql, connection);
         OracleDataReader oracleReader = cmd.ExecuteReader();
         while (oracleReader.Read())
         {
             PBX_Image.BackgroundImage = DB_Images.Find(oracleReader.GetString(0));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
 private void LBX_Monuments_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string           sql3    = "SELECT M.DATEDECREATION, CM.ORDREDEVISITE, M.GUID, M.NBETOILES, M.HISTOIRE FROM MONUMENTS M INNER JOIN CIRCUITMONUMENTS CM ON M.IDMONUMENT = CM.IDMONUMENT WHERE M.NOM ='" + LBX_Monuments.SelectedItem.ToString() + "'";
         OracleCommand    cmd3    = new OracleCommand(sql3, mOracleConnection);
         OracleDataReader reader2 = cmd3.ExecuteReader();
         reader2.Read();
         DTP_DateMonument.Value        = reader2.GetDateTime(0);
         TBX_Ordre.Text                = reader2.GetValue(1).ToString();
         IMB_Monuments.BackgroundImage = mDB_Images.Find(reader2.GetValue(2).ToString());
         Etoiles.Value      = reader2.GetInt32(3);
         RTBX_Histoire.Text = reader2.GetValue(4).ToString();
         reader2.Close();
     }
     catch (Exception)
     {
         MessageBox.Show("Le monument ne contient aucune photo!");
     }
 }
        private void DGV_monument_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string        sql4 = "select image from monument where nom = '" + DGV_monument.CurrentRow.Cells[0].Value + "'";
            OracleCommand cmd4 = new OracleCommand(sql4, connection);

            cmd4.CommandType = CommandType.Text;
            OracleDataReader reader3 = cmd4.ExecuteReader();

            reader3.Read();
            string GUID = reader3.GetString(0);

            reader3.Close();
            if (GUID != null)
            {
                // string GUID = LBX_ImagesGUIDs.SelectedItem.ToString();
                PBX_SelectedGUID.Image = DB_Images.Find(GUID);
            }
            else
            {
                PBX_SelectedGUID.BackgroundImage = null;
            }
        }
        private void UpdatePxbImage()
        {
            try
            {
                string           sql          = "SELECT IMAGE FROM MONUMENTS WHERE nom = '" + lbxMonuments.Text + "'";
                OracleCommand    cmd          = new OracleCommand(sql, mConnexionDAL.GetConnexion());
                OracleDataReader oracleReader = cmd.ExecuteReader();
                while (oracleReader.Read())
                {
                    Image image = DB_Images.Find(oracleReader.GetString(0));

                    if (image != null)
                    {
                        pbxMonument.BackgroundImage = image;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
 private void AfficherImage()
 {
     PBX_Image.BackgroundImage = DB_Images.Find(GBX_Monuments.Name);
 }