예제 #1
0
        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
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: homePage.cs 프로젝트: CrazyAvak/smam2
        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();
            }
        }
예제 #4
0
        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());
            }
        }
예제 #5
0
        public dbConnection()
        {
            connectionString = "Server=localhost;Database=smamdb;Uid=root;Pwd=;";

            try
            {
                conn = new MySqlConnection(connectionString);
            }
            catch (Exception exception)
            {
                ExceptionToText ex = new ExceptionToText(exception.ToString());
            }
        }
예제 #6
0
파일: Typelist.cs 프로젝트: CrazyAvak/Smam
 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());
     }
 }
예제 #7
0
파일: Typelist.cs 프로젝트: CrazyAvak/smam2
 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
     }
 }
예제 #8
0
 public startSettings()
 {
     InitializeComponent();
     CenterToScreen();
     try
     {
         AddFonts();
     }
     catch (Exception exception)
     {
         ExceptionToText ex = new ExceptionToText(exception.ToString());
     }
     designing();
     //label1.Left = (this.ClientSize.Width - label1.Width) / 2;
 }
예제 #9
0
 public shoppingList()
 {
     InitializeComponent();
     CenterToScreen();
     try
     {
         AddFonts();
     }
     catch (Exception exception)
     {
         ExceptionToText ex = new ExceptionToText(exception.ToString());
     }
     setbackground();
     smam = new smamController();
     fillTypes();
 }
예제 #10
0
 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);
 }
예제 #11
0
파일: homePage.cs 프로젝트: CrazyAvak/smam2
 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();
 }
예제 #12
0
파일: Typelist.cs 프로젝트: CrazyAvak/smam2
 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());
     }
 }
예제 #13
0
 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;
 }
예제 #14
0
파일: poi2.cs 프로젝트: CrazyAvak/smam2
        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();
        }
예제 #15
0
 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());
     }
 }
예제 #16
0
파일: Typelist.cs 프로젝트: CrazyAvak/smam2
        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
        }