using System;
using System.Windows.Forms;

using System.Configuration;

namespace Baza_Reklam
{
    public partial class About : Form
    {
        public About()
        {
            InitializeComponent();

            lblVersion.Text = Application.ProductVersion;

            lblDB.Text = ConnString.GetDataBaseInfo();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void lblVersionInfo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string url = string.IsNullOrEmpty(ConfigurationManager.AppSettings["Application.Version.Url"])
                                 ? "http://www.infocity.pl/baza_reklam/versioninfo.html#{0}"
                                 : ConfigurationManager.AppSettings["Application.Version.Url"];

            System.Diagnostics.Process.Start(string.Format(url, Application.ProductVersion));
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string url = string.IsNullOrEmpty(ConfigurationManager.AppSettings["Application.Instruction.Url"])
                                 ? "http://www.infocity.pl/baza_reklam/instrukcja.htm"
                                 : ConfigurationManager.AppSettings["Application.Instruction.Url"];

            System.Diagnostics.Process.Start(url);
        }
    }
}