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

using INT51DB.Forms;
using SmartX;
using INT51DB_ImageDll;

namespace INT51DB.Controls
{
    public partial class ControlCenterBasicHelp : UserControl
    {
        #region Field
        private FormMenu m_ParentForm;

        private DataStore.MenuBottomBasic CurrentMenu;
        #endregion

        #region Constructor
        public ControlCenterBasicHelp(FormMenu parent)
        {
            InitializeComponent();

            this.ParentForm = parent;

            this.InitializeDesign();
            this.DefaultSetting();
        }
        #endregion

        #region Property
        public FormMenu ParentForm
        {
            get { return this.m_ParentForm; }
            private set { this.m_ParentForm = value; }
        }
        #endregion

        #region Method
        public void InitializeDesign()
        {
            Class1 images = new Class1();

            if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.English)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.Chinese)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.LanguageID.Czech)
            {
            }
            else
            {
            }
        }
        private void DefaultSetting()
        {
            this.CurrentMenu = DataStore.MenuBottomBasic.Help;
        }

        public void DisplayRefresh(DataStore.UserGroup group)
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = DataStore.DisplayStore.BasicHelp;
            this.ParentForm.ParentForm.SetDisplayMode(DataStore.DisplayMode.Menu);
            this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
        }
        #endregion

        #region Event Handler
        private void buttonMenu_Click(object sender, EventArgs e)
        {
            SmartButton button = sender as SmartButton;

            if (button == null)
                return;

            if (button == this.buttonTime)
                this.CurrentMenu = DataStore.MenuBottomBasic.Time;
            else if (button == this.buttonProduct)
                this.CurrentMenu = DataStore.MenuBottomBasic.Product;
            else if (button == this.buttonDataBackup)
                this.CurrentMenu = DataStore.MenuBottomBasic.DataBackup;
            else if (button == this.buttonDataStatistics)
                this.CurrentMenu = DataStore.MenuBottomBasic.DataStatistics;
            else
                this.CurrentMenu = DataStore.MenuBottomBasic.Help;

            this.ParentForm.DisplayBottomBasic(this.CurrentMenu);
        }
        #endregion
    }
}
