private void loadBG() { string articleID = smamControl.GetArticleID(articleName); try { pictureBox1.Load(smamControl.GetBackgroundURL(articleID)); foreach (Control item in this.Controls)//kijkt tussen al de controls of er controls bestaan met de if statement namen { if (item.Name != "labelTitelArticle" && item.Name != "buttonBack") { item.BackColor = Color.FromArgb(248, 248, 248); } } } catch (Exception exception) { labelTitelArticle.ForeColor = Color.Black; foreach (Control item in this.Controls) { if (item.Name != "buttonBack") { item.BackColor = Color.FromArgb(248, 248, 248); } } buttonBack.BringToFront(); ExceptionToText ex = new ExceptionToText(exception.ToString()); } labelTitelArticle.Parent = pictureBox1; buttonBack.Parent = pictureBox1; labelTitelArticle.Focus(); //focussen op een label zorgt ervoor dat er geen knipperende cursor is }
public Hint getHint()//geeft een hint object terug { DataTable table = new DataTable(); try { conn.Open(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); return(null); } string query = "SELECT * FROM `hint` ORDER BY RAND() LIMIT 1;"; MySqlCommand cmd = new MySqlCommand(query, conn); MySqlDataAdapter myAdapter = new MySqlDataAdapter(); myAdapter.SelectCommand = cmd; myAdapter.Fill(table); conn.Close(); Hint hint = new Hint(); foreach (DataRow item in table.Rows) { hint.Id = item["idHints"].ToString(); hint.Name = item["Name"].ToString(); hint.Body = item["Description"].ToString(); } return(hint); }
private void fillHint() { string betaalhuur = "Vergeet vandaag je huur niet te betalen!"; try { if (DateTime.Today.Day.ToString() == Properties.Settings.Default.dayRent.ToString()) { labelHint.Text = betaalhuur; labelHint.ForeColor = Color.Red; } else { labelHint.Text = smam.getHint().Body; labelHint.ForeColor = Color.Black; } labelHint.Left = (this.ClientSize.Width - labelHint.Width) / 2; } catch (Exception exception) { MessageBox.Show("Het is niet gelukt om verbinding te maken met de server. SMAM zal nu sluiten."); ExceptionToText ex = new ExceptionToText(exception.ToString()); Application.Exit(); } }
public dbConnection() { connectionString = "Server=localhost;Database=smamdb;Uid=root;Pwd=;";//de connectionstring met de wachtwoorden etc om te verbinden try { conn = new MySqlConnection(connectionString); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } }
public dbConnection() { connectionString = "Server=localhost;Database=smamdb;Uid=root;Pwd=;"; try { conn = new MySqlConnection(connectionString); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } }
private void listBox1_DoubleClick(object sender, EventArgs e) { try { string articlename = listBox1.SelectedItem.ToString(); this.Hide(); smamControl.openArtikel(articlename); this.Show(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } }
private void listBox1_DoubleClick(object sender, EventArgs e)//als je dubbelklikt gaat die door naar het geklikte artikel { try { string articlename = listBox1.SelectedItem.ToString(); this.Hide(); smamControl.openArtikel(articlename); this.Show(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString());//als er iets fout is schrijft die in het log bestand via ExceptionToText klasse } }
public startSettings() { InitializeComponent(); CenterToScreen(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } designing(); //label1.Left = (this.ClientSize.Width - label1.Width) / 2; }
public shoppingList() { InitializeComponent(); CenterToScreen(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } setbackground(); smam = new smamController(); fillTypes(); }
public ArticleForm(string articlename) //constructor { InitializeComponent(); smamControl = new smamController(); CenterToScreen(); //Form in het midden zetten try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } this.articleName = articlename; this.BackColor = Color.FromArgb(248, 248, 248); }
public homePage() { smam = new smamController(); InitializeComponent(); this.BackColor = Color.FromArgb(248, 248, 248); setbackground(); CenterToScreen(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } fillHint(); }
public Typelist(string naamtype) { InitializeComponent(); CenterToScreen(); //Form in het midden zetten smamControl = new smamController(); this.naamType = naamtype; setbackground(); loadBG(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } }
public settingsEdit() { InitializeComponent(); CenterToScreen(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } setbackground(); smam = new smamController(); getSettings(); labelTitel.Left = (this.ClientSize.Width - labelTitel.Width) / 2; }
public poi2() { InitializeComponent(); CenterToScreen(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } setbackground(); saveUserSettings settings = new saveUserSettings(); city = settings.getCity(); this.Text = city; InitializeChromium(); }
public SplashScreenForm() { InitializeComponent(); CenterToScreen(); designing(); time = new Timer(); //if (Debugger.IsAttached) //{ // Settings.Default.Reset(); //} checkStart(); try { AddFonts(); } catch (Exception exception) { ExceptionToText ex = new ExceptionToText(exception.ToString()); } }
private void loadBG() { string articleID = smamControl.GetArticleIDFromType(smamControl.GetTypeName(naamType)); Console.WriteLine(smamControl.GetBackgroundURL(articleID)); try { pictureBox1.Load(smamControl.GetBackgroundURL(articleID)); foreach (Control item in this.Controls) { if (item.Name != "labelTitelArticle" && item.Name != "buttonBack") { item.BackColor = Color.FromArgb(248, 248, 248); } labelTitle.Parent = pictureBox1; labelTitle.BackColor = Color.Transparent; labelTitle.ForeColor = Color.White; buttonBack.Parent = pictureBox1; buttonBack.BackColor = Color.Transparent; labelTitle.BringToFront(); buttonBack.BringToFront(); } } catch (Exception exception) { labelTitle.ForeColor = Color.Black; foreach (Control item in this.Controls) { if (item.Name != "buttonBack") { item.BackColor = Color.FromArgb(248, 248, 248); } } buttonBack.BringToFront(); ExceptionToText ex = new ExceptionToText(exception.ToString()); } labelTitle.Focus(); //focussen op een label zorgt ervoor dat er geen knipperende cursor is }