コード例 #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
ファイル: dbConnection.cs プロジェクト: CrazyAvak/smam2
        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
ファイル: dbConnection.cs プロジェクト: CrazyAvak/smam2
        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
ファイル: startSettings.cs プロジェクト: CrazyAvak/smam2
 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
ファイル: SplashScreenForm.cs プロジェクト: CrazyAvak/smam2
 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
        }