using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SanSystem
{
    /// <summary>
    /// 
    /// </summary>
    public partial class FrmSelectNewSan : Form
    {
        /// <summary>
        /// Neue Inliner wurde angeklickt
        /// </summary>
        public event EventHandler AddInlinerClicked;
        /// <summary>
        /// Neue Schachtanbindung wurde angeklickt
        /// </summary>
        public event EventHandler AddSchachtAnbindungClicked;
        /// <summary>
        /// Neue Kurzliner wurde angeklickt
        /// </summary>
        public event EventHandler AddKurzlinerClicked;
        /// <summary>
        /// Neue Hutprofil wurde angeklickt
        /// </summary>
        public event EventHandler AddHutprofilClicked;
        /// <summary>
        /// Neue Quicklock wurde angeklickt
        /// </summary>
        public event EventHandler AddQuicklockClicked;
       
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnAddSchachtAnbindungClicked(EventArgs e)
        {
            EventHandler handler = AddSchachtAnbindungClicked;
            if (handler != null) handler(this, e);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnAddInlinerClicked(EventArgs e)
        {
            EventHandler handler = AddInlinerClicked;
            if (handler != null) handler(this, e);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnAddKurzlinerClicked(EventArgs e)
        {
            EventHandler handler = AddKurzlinerClicked;
            if (handler != null) handler(this, e);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnAddHutClicked(EventArgs e)
        {
            EventHandler handler = AddHutprofilClicked;
            if (handler != null) handler(this, e);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnAddQuickLockClicked(EventArgs e)
        {
            EventHandler handler = AddQuicklockClicked;
            if (handler != null) handler(this, e);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mod"></param>
        public FrmSelectNewSan(int mod)
        {
            InitializeComponent();

            SanArt sanArt = new SanArt(mod);

            btn_inliner.Text = Global.Instance.language.Labels["inliner"];
            btn_hut.Text = Global.Instance.language.Labels["hut"];
            btn_kurzliner.Text = Global.Instance.language.Labels["kurzliner"];
            btn_schacht_anb.Text = Global.Instance.language.Labels["schacht_an"];

            btn_inliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.INLINER);
            btn_kurzliner.Enabled = sanArt.SanierungActivated(Sanierungsarten.KURZLINER);
            btn_hut.Enabled = sanArt.SanierungActivated(Sanierungsarten.HUTPROFIL);
            btn_schacht_anb.Enabled = sanArt.SanierungActivated(Sanierungsarten.SCHACHTANBINDUNG);
            //btn_hut.Enabled = btn_kurzliner.Enabled = false;
        }

        private void btn_inliner_Click(object sender, EventArgs e)
        {
            OnAddInlinerClicked(EventArgs.Empty);
            this.Close();
        }

        private void btn_schacht_anb_Click(object sender, EventArgs e)
        {
            OnAddSchachtAnbindungClicked(EventArgs.Empty);
            this.Close();
        }

        private void btn_kurzliner_Click(object sender, EventArgs e)
        {
            OnAddKurzlinerClicked(EventArgs.Empty);
            this.Close();
        }

        private void btn_hut_Click(object sender, EventArgs e)
        {
            OnAddHutClicked(EventArgs.Empty);
            this.Close();
        }
    }
}
