private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //adiazei to panel panel1.Controls.Clear(); arxiki ar = new arxiki(); tixeo_lima(ar);//kali tin function tixeo_lima ar.Show(); panel1.Controls.Add(ar); }
public Formkentriki() { InitializeComponent(); //adiazei to panel panel1.Controls.Clear(); arxiki ar = new arxiki(); ar.Show(); panel1.Controls.Add(ar); }
//kodikas emfanisis tixeon limaton{Rafail} stin arxiki public void tixeo_lima(arxiki ar) { Random rnd = new Random(); int article_id_1 = rnd.Next(18, 601301);//18 mikrotero id 601301 megalitero int article_id_2 = rnd.Next(18, 601301); int article_id_3 = rnd.Next(18, 601301); OPENXMLTestingEntities1 article_tixeo = new OPENXMLTestingEntities1(); //tixeo lima 1 var get_article_tixeo = article_tixeo.articles.Where(a => a.id == article_id_1).SingleOrDefault(); var get_article_image_tixeo = article_tixeo.imagelinks.Where(a => a.il_from == article_id_1).First(); ar.Label14.Text = get_article_tixeo.title; ar.Label15.Text = get_article_tixeo.kimeno; string get_article_image_tixeo_il_to = get_article_image_tixeo.il_to; //pernoume to onoma tou arxiou string image_path_tixeo = "https://el.wikipedia.org/wiki/%CE%91%CF%81%CF%87%CE%B5%CE%AF%CE%BF:" + get_article_image_tixeo_il_to; //topothetoume to arxio se url tis wikipidia ar.PictureBox7.Image = Image.FromFile(image_path_tixeo); //emfanizoume to arxio //tixeo lima 2 get_article_tixeo = article_tixeo.articles.Where(a => a.id == article_id_1).SingleOrDefault(); get_article_image_tixeo = article_tixeo.imagelinks.Where(a => a.il_from == article_id_1).First(); ar.Label16.Text = get_article_tixeo.title; ar.Label17.Text = get_article_tixeo.kimeno; get_article_image_tixeo_il_to = get_article_image_tixeo.il_to; image_path_tixeo = "https://el.wikipedia.org/wiki/%CE%91%CF%81%CF%87%CE%B5%CE%AF%CE%BF:" + get_article_image_tixeo_il_to; ar.PictureBox8.Image = Image.FromFile(image_path_tixeo); //tixeo lima 3 get_article_tixeo = article_tixeo.articles.Where(a => a.id == article_id_1).SingleOrDefault(); get_article_image_tixeo = article_tixeo.imagelinks.Where(a => a.il_from == article_id_1).First(); ar.Label18.Text = get_article_tixeo.title; ar.Label19.Text = get_article_tixeo.kimeno; get_article_image_tixeo_il_to = get_article_image_tixeo.il_to; image_path_tixeo = "https://el.wikipedia.org/wiki/%CE%91%CF%81%CF%87%CE%B5%CE%AF%CE%BF:" + get_article_image_tixeo_il_to;// ar.PictureBox9.Image = Image.FromFile(image_path_tixeo); }