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

using SmartX;
using INT69DC_ImageDll;
using INT69DC_7C.DialogForms;
using INT69DC_7C.Part11_UserManager;

namespace INT69DC_7C.Forms
{
    public partial class FormMenu : Form
    {
        #region Field
        private FormMain m_ParentForm;
        #endregion

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

            this.ParentForm = parent;
        }
        #endregion

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

        #region Method
        private void InitializeDesign()
        {
            ImageDll images = new ImageDll();

            if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Korean)
            {

            }
            else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.English)
            {
                #region English
                this.buttonTimeSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuTimeDisable));
                this.buttonTimeSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuTimeDown));
                this.buttonTimeSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuTimeUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInformationUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuConfigurationDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuConfigurationDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuConfigurationUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataStatisticsUp));
                this.buttonCalibration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCalibrationDisable));
                this.buttonCalibration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCalibrationDown));
                this.buttonCalibration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCalibrationUp));
                this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUpdateDisable));
                this.buttonUpdate.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUpdateDown));
                this.buttonUpdate.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUpdateUp));
                this.buttonSysConfig.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuSystemSettingDisable));
                this.buttonSysConfig.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuSystemSettingDown));
                this.buttonSysConfig.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuSystemSettingUp));
                this.buttonFactoryInitialize.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInitializationDisable));
                this.buttonFactoryInitialize.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInitializationDown));
                this.buttonFactoryInitialize.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuInitializationUp));
                this.buttonMotorSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuMotorSettingDisable));
                this.buttonMotorSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuMotorSettingDown));
                this.buttonMotorSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuMotorSettingUp));
                this.buttonEquipmentSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentSettingDisable));
                this.buttonEquipmentSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentSettingDown));
                this.buttonEquipmentSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentSettingUp));
                this.buttonIOTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuIOTestDisable));
                this.buttonIOTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuIOTestDown));
                this.buttonIOTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuIOTestUp));
                this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentTestDisable));
                this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentTestDown));
                this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuEquipmentTestUp));
                this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUserSettingDisable));
                this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUserSettingDown));
                this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuUserSettingUp));
                this.buttonOptionSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuOptionDisable));
                this.buttonOptionSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuOptionDown));
                this.buttonOptionSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuOptionUp));
                this.buttonCommunication.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCommunicationDisable));
                this.buttonCommunication.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCommunicationDown));
                this.buttonCommunication.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuCommunicationUp));
                this.buttonDataViewer.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataViewerDisable));
                this.buttonDataViewer.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataViewerDown));
                this.buttonDataViewer.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engMenuDataViewerUp));

                this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackupDisable));
                this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackDown));
                this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackUp));
                #endregion
            }
            else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Chinese)
            {
                #region Chinese
                this.buttonTimeSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuTimeDisable));
                this.buttonTimeSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuTimeDown));
                this.buttonTimeSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuTimeUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInformationUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuConfigurationDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuConfigurationDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuConfigurationUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataStatisticsUp));
                this.buttonCalibration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCalibrationDisable));
                this.buttonCalibration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCalibrationDown));
                this.buttonCalibration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCalibrationUp));
                this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUpdateDisable));
                this.buttonUpdate.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUpdateDown));
                this.buttonUpdate.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUpdateUp));
                this.buttonSysConfig.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuSystemSettingDisable));
                this.buttonSysConfig.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuSystemSettingDown));
                this.buttonSysConfig.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuSystemSettingUp));
                this.buttonFactoryInitialize.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInitializationDisable));
                this.buttonFactoryInitialize.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInitializationDown));
                this.buttonFactoryInitialize.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuInitializationUp));
                this.buttonMotorSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuMotorSettingDisable));
                this.buttonMotorSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuMotorSettingDown));
                this.buttonMotorSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuMotorSettingUp));
                this.buttonEquipmentSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentSettingDisable));
                this.buttonEquipmentSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentSettingDown));
                this.buttonEquipmentSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentSettingUp));
                this.buttonIOTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuIOTestDisable));
                this.buttonIOTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuIOTestDown));
                this.buttonIOTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuIOTestUp));
                this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentTestDisable));
                this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentTestDown));
                this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuEquipmentTestUp));
                this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUserSettingDisable));
                this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUserSettingDown));
                this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuUserSettingUp));
                this.buttonOptionSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuOptionDisable));
                this.buttonOptionSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuOptionDown));
                this.buttonOptionSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuOptionUp));
                this.buttonCommunication.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCommunicationDisable));
                this.buttonCommunication.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCommunicationDown));
                this.buttonCommunication.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuCommunicationUp));
                this.buttonDataViewer.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataViewerDisable));
                this.buttonDataViewer.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataViewerDown));
                this.buttonDataViewer.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnMenuDataViewerUp));

                this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackupDisable));
                this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackDown));
                this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackUp));
                #endregion
            }
            else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Czech)
            {
                #region Czech
                this.buttonTimeSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuTimeDisable));
                this.buttonTimeSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuTimeDown));
                this.buttonTimeSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuTimeUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInformationUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuConfigurationDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuConfigurationDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuConfigurationUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataStatisticsUp));
                this.buttonCalibration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCalibrationDisable));
                this.buttonCalibration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCalibrationDown));
                this.buttonCalibration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCalibrationUp));
                this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUpdateDisable));
                this.buttonUpdate.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUpdateDown));
                this.buttonUpdate.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUpdateUp));
                this.buttonSysConfig.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuSystemSettingDisable));
                this.buttonSysConfig.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuSystemSettingDown));
                this.buttonSysConfig.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuSystemSettingUp));
                this.buttonFactoryInitialize.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInitializationDisable));
                this.buttonFactoryInitialize.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInitializationDown));
                this.buttonFactoryInitialize.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuInitializationUp));
                this.buttonMotorSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuMotorSettingDisable));
                this.buttonMotorSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuMotorSettingDown));
                this.buttonMotorSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuMotorSettingUp));
                this.buttonEquipmentSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentSettingDisable));
                this.buttonEquipmentSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentSettingDown));
                this.buttonEquipmentSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentSettingUp));
                this.buttonIOTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuIOTestDisable));
                this.buttonIOTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuIOTestDown));
                this.buttonIOTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuIOTestUp));
                this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentTestDisable));
                this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentTestDown));
                this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuEquipmentTestUp));
                this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUserSettingDisable));
                this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUserSettingDown));
                this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuUserSettingUp));
                this.buttonOptionSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuOptionDisable));
                this.buttonOptionSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuOptionDown));
                this.buttonOptionSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuOptionUp));
                this.buttonCommunication.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCommunicationDisable));
                this.buttonCommunication.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCommunicationDown));
                this.buttonCommunication.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuCommunicationUp));
                this.buttonDataViewer.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataViewerDisable));
                this.buttonDataViewer.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataViewerDown));
                this.buttonDataViewer.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeMenuDataViewerUp));

                this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackupDisable));
                this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackDown));
                this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackUp));
                #endregion
            }
            else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.German)
            {
                #region German
                this.buttonTimeSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuTimeDisable));
                this.buttonTimeSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuTimeDown));
                this.buttonTimeSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuTimeUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInformationUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuConfigurationDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuConfigurationDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuConfigurationUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataStatisticsUp));
                this.buttonCalibration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCalibrationDisable));
                this.buttonCalibration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCalibrationDown));
                this.buttonCalibration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCalibrationUp));
                this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUpdateDisable));
                this.buttonUpdate.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUpdateDown));
                this.buttonUpdate.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUpdateUp));
                this.buttonSysConfig.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuSystemSettingDisable));
                this.buttonSysConfig.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuSystemSettingDown));
                this.buttonSysConfig.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuSystemSettingUp));
                this.buttonFactoryInitialize.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInitializationDisable));
                this.buttonFactoryInitialize.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInitializationDown));
                this.buttonFactoryInitialize.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuInitializationUp));
                this.buttonMotorSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuMotorSettingDisable));
                this.buttonMotorSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuMotorSettingDown));
                this.buttonMotorSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuMotorSettingUp));
                this.buttonEquipmentSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentSettingDisable));
                this.buttonEquipmentSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentSettingDown));
                this.buttonEquipmentSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentSettingUp));
                this.buttonIOTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuIOTestDisable));
                this.buttonIOTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuIOTestDown));
                this.buttonIOTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuIOTestUp));
                this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentTestDisable));
                this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentTestDown));
                this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuEquipmentTestUp));
                this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUserSettingDisable));
                this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUserSettingDown));
                this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuUserSettingUp));
                this.buttonOptionSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuOptionDisable));
                this.buttonOptionSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuOptionDown));
                this.buttonOptionSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuOptionUp));
                this.buttonCommunication.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCommunicationDisable));
                this.buttonCommunication.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCommunicationDown));
                this.buttonCommunication.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuCommunicationUp));
                this.buttonDataViewer.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataViewerDisable));
                this.buttonDataViewer.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataViewerDown));
                this.buttonDataViewer.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerMenuDataViewerUp));

                this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackupDisable));
                this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackDown));
                this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackUp));
                #endregion
            }
            else if (this.ParentForm.SystemConfig.Language == DataStore.LanguageID.Japanese)
            {
                #region Japanese
                this.buttonTimeSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuTimeDisable));
                this.buttonTimeSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuTimeDown));
                this.buttonTimeSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuTimeUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInformationUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuConfigurationDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuConfigurationDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuConfigurationUp));
                this.buttonDataBackup.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataBackupDisable));
                this.buttonDataBackup.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataBackupDown));
                this.buttonDataBackup.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataBackupUp));
                this.buttonDataStatistics.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataStatisticsDisable));
                this.buttonDataStatistics.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataStatisticsDown));
                this.buttonDataStatistics.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataStatisticsUp));
                this.buttonCalibration.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCalibrationDisable));
                this.buttonCalibration.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCalibrationDown));
                this.buttonCalibration.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCalibrationUp));
                this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUpdateDisable));
                this.buttonUpdate.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUpdateDown));
                this.buttonUpdate.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUpdateUp));
                this.buttonSysConfig.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuSystemSettingDisable));
                this.buttonSysConfig.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuSystemSettingDown));
                this.buttonSysConfig.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuSystemSettingUp));
                this.buttonFactoryInitialize.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInitializationDisable));
                this.buttonFactoryInitialize.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInitializationDown));
                this.buttonFactoryInitialize.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuInitializationUp));
                this.buttonMotorSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuMotorSettingDisable));
                this.buttonMotorSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuMotorSettingDown));
                this.buttonMotorSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuMotorSettingUp));
                this.buttonEquipmentSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentSettingDisable));
                this.buttonEquipmentSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentSettingDown));
                this.buttonEquipmentSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentSettingUp));
                this.buttonIOTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuIOTestDisable));
                this.buttonIOTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuIOTestDown));
                this.buttonIOTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuIOTestUp));
                this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentTestDisable));
                this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentTestDown));
                this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuEquipmentTestUp));
                this.buttonUser.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUserSettingDisable));
                this.buttonUser.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUserSettingDown));
                this.buttonUser.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuUserSettingUp));
                this.buttonOptionSetting.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuOptionDisable));
                this.buttonOptionSetting.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuOptionDown));
                this.buttonOptionSetting.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuOptionUp));
                this.buttonCommunication.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCommunicationDisable));
                this.buttonCommunication.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCommunicationDown));
                this.buttonCommunication.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuCommunicationUp));
                this.buttonDataViewer.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataViewerDisable));
                this.buttonDataViewer.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataViewerDown));
                this.buttonDataViewer.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnMenuDataViewerUp));

                this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackupDisable));
                this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackDown));
                this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackUp));
                #endregion
            }
            else
            {

            }
        }
        private void InitializeControl()
        {
            if (this.ParentForm.SystemConfig.IsLogin == false)
            {
                this.labelUserID.Visible = false;
                this.labelUserLevel.Visible = false;
                this.buttonUser.Visible = false;
                this.buttonEquipmentTest.Visible = false;
            }
        }

        public void UpdateDisplayMenuAccess(UserItem user)
        {
            string id = "", group = "", expirePW = "";
            int expireDate = 0;
            Color colorExpirePW = this.ParentForm.ColorLogOff;

            if (this.ParentForm.SystemConfig.IsOptPart11 == true)
            {
                this.buttonDataStatistics.Visible = true;
                this.buttonDataViewer.Visible = true;
                this.buttonUser.Visible = true;
            }
            else
            {
                this.buttonDataViewer.Visible = false;

                if (this.ParentForm.SystemConfig.IsLogin == true)
                    this.buttonUser.Visible = true;
                else
                    this.buttonUser.Visible = false;

                // 옵션 데이터집계
                if (this.ParentForm.SystemConfig.IsOptDataStatistics == true)
                {
                    this.buttonDataStatistics.Visible = true;
                    this.buttonUser.Location = new Point(this.buttonDataViewer.Location.X, this.buttonDataViewer.Location.Y);
                }
                else
                {
                    this.buttonDataStatistics.Visible = false;
                    this.buttonUser.Location = new Point(this.buttonDataStatistics.Location.X, this.buttonDataStatistics.Location.Y);
                }
            }

            switch (user.Group)
            {
                case DataStore.UserGroup.None:
                    break;
                case DataStore.UserGroup.Level1:
                    #region Level1
                    id = user.ID;
                    group = this.ParentForm.SystemConfig.User_Level1_Name;

                    if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;

                    this.buttonInformation.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuInformation;
                    this.buttonDataBackup.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuDataBackup;
                    this.buttonConfiguration.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuConfiguration;
                    this.buttonCommunication.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuCommunication;
                    this.buttonCalibration.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuCalibration;

                    this.buttonSysConfig.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuSystem;
                    this.buttonMotorSetting.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuMotor;
                    this.buttonUpdate.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuUpdate;
                    this.buttonFactoryInitialize.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuInitialization;
                    this.buttonIOTest.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuIOTest;

                    this.buttonEquipmentSetting.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuEquipment;
                    this.buttonTimeSetting.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuTime;
                    this.buttonUser.Enabled = true;
                    this.buttonDataStatistics.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuStatistics;
                    this.buttonDataViewer.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMenuViewer;

                    this.buttonEquipmentTest.Visible = false;
                    this.buttonOptionSetting.Visible = false;

                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.labelExpireOfPassword.Visible = true;
                    #endregion
                    break;
                case DataStore.UserGroup.Level2:
                    #region Level2
                    id = user.ID;
                    group = this.ParentForm.SystemConfig.User_Level2_Name;

                    if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;

                    this.buttonInformation.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuInformation;
                    this.buttonDataBackup.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuDataBackup;
                    this.buttonConfiguration.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuConfiguration;
                    this.buttonCommunication.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuCommunication;
                    this.buttonCalibration.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuCalibration;

                    this.buttonSysConfig.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuSystem;
                    this.buttonMotorSetting.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuMotor;
                    this.buttonUpdate.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuUpdate;
                    this.buttonFactoryInitialize.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuInitialization;
                    this.buttonIOTest.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuIOTest;

                    this.buttonEquipmentSetting.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuEquipment;
                    this.buttonTimeSetting.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuTime;
                    this.buttonUser.Enabled = true;
                    this.buttonDataStatistics.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuStatistics;
                    this.buttonDataViewer.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMenuViewer;

                    this.buttonEquipmentTest.Visible = false;
                    this.buttonOptionSetting.Visible = false;

                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.labelExpireOfPassword.Visible = true;
                    #endregion
                    break;
                case DataStore.UserGroup.Level3:
                    #region Level3
                    id = user.ID;
                    group = this.ParentForm.SystemConfig.User_Level3_Name;

                    if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;

                    this.buttonInformation.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuInformation;
                    this.buttonDataBackup.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuDataBackup;
                    this.buttonConfiguration.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuConfiguration;
                    this.buttonCommunication.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuCommunication;
                    this.buttonCalibration.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuCalibration;

                    this.buttonSysConfig.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuSystem;
                    this.buttonMotorSetting.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuMotor;
                    this.buttonUpdate.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuUpdate;
                    this.buttonFactoryInitialize.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuInitialization;
                    this.buttonIOTest.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuIOTest;

                    this.buttonEquipmentSetting.Enabled = true;
                    this.buttonTimeSetting.Enabled = true;
                    this.buttonUser.Enabled = true;
                    this.buttonDataStatistics.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuStatistics;
                    this.buttonDataViewer.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMenuViewer;

                    this.buttonEquipmentTest.Visible = false;
                    this.buttonOptionSetting.Visible = false;

                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.labelExpireOfPassword.Visible = true;
                    #endregion
                    break;
                case DataStore.UserGroup.Admin:
                    #region Admin
                    id = user.ID;
                    group = "Administrator";
                  
                    if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;

                    this.buttonInformation.Enabled = true;
                    this.buttonDataBackup.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonCommunication.Enabled = true;
                    this.buttonCalibration.Enabled = true;

                    this.buttonSysConfig.Enabled = true;
                    this.buttonMotorSetting.Enabled = true;
                    this.buttonUpdate.Enabled = true;
                    this.buttonFactoryInitialize.Enabled = true;
                    this.buttonIOTest.Enabled = true;

                    this.buttonEquipmentSetting.Enabled = true;
                    this.buttonTimeSetting.Enabled = true;
                    this.buttonUser.Enabled = true;
                    this.buttonDataStatistics.Enabled = true;
                    this.buttonDataViewer.Enabled = true;

                    this.buttonEquipmentTest.Visible = false;
                    this.buttonOptionSetting.Visible = false;

                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.labelExpireOfPassword.Visible = true;
                    #endregion
                    break;
                case DataStore.UserGroup.Developer:
                    #region Developer
                    id = user.ID;
                    group = "Developer";

                    if (this.labelUserLevel.ForeColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.ForeColor = this.labelUserID.ForeColor = this.ParentForm.ColorLogOn;

                    this.buttonInformation.Enabled = true;
                    this.buttonDataBackup.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonCommunication.Enabled = true;
                    this.buttonCalibration.Enabled = true;

                    this.buttonSysConfig.Enabled = true;
                    this.buttonMotorSetting.Enabled = true;
                    this.buttonUpdate.Enabled = true;
                    this.buttonFactoryInitialize.Enabled = true;
                    this.buttonIOTest.Enabled = true;

                    this.buttonEquipmentSetting.Enabled = true;
                    this.buttonTimeSetting.Enabled = true;
                    this.buttonUser.Enabled = true;
                    this.buttonDataStatistics.Enabled = true;
                    this.buttonDataViewer.Enabled = true;

                    this.buttonEquipmentTest.Visible = true;
                    this.buttonOptionSetting.Visible = true;

                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.labelExpireOfPassword.Visible = true;
                    #endregion
                    break;
                case DataStore.UserGroup.NotLogin:
                    #region NotLogin
                    // true
                    this.buttonInformation.Enabled = true;
                    this.buttonDataBackup.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonCommunication.Enabled = true;
                    this.buttonCalibration.Enabled = true;

                    this.buttonSysConfig.Enabled = true;
                    this.buttonMotorSetting.Enabled = true;
                    this.buttonUpdate.Enabled = true;
                    this.buttonFactoryInitialize.Enabled = true;
                    this.buttonIOTest.Enabled = true;

                    this.buttonEquipmentSetting.Enabled = true;
                    this.buttonTimeSetting.Enabled = true;
                    
                    // false
                    this.buttonEquipmentTest.Visible = false;
                    this.buttonOptionSetting.Visible = false;
                    this.buttonUser.Enabled = false;
                    this.buttonDataViewer.Visible = false;

                    // 옵션 데이터집계
                    if (this.ParentForm.SystemConfig.IsOptDataStatistics == true)
                        this.buttonDataStatistics.Visible = true;
                    else
                        this.buttonDataStatistics.Visible = false;
                    #endregion
                    break;
                case DataStore.UserGroup.LogOut:
                    group = "Log out";
                    this.labelExpireOfPassword.Visible = false;
                    break;
                default:
                    break;
            }

            //if (this.ParentForm.SystemConfig.IsLogin == true)
            //{
            //    if (this.ParentForm.SystemConfig.IsPart11 == true)
            //    {
            //        if (user.ExpirePassword != 0)
            //        {
            //            expireDate = user.GetPasswordExpiryDday();
            //            if (expireDate == 9999)
            //            {
            //                // Administrator or Developer
            //                colorExpirePW = this.ParentForm.ColorLogOn;
            //                expirePW = "-";

            //            }
            //            else
            //            {
            //                if (expireDate >= -10)
            //                {
            //                    colorExpirePW = this.ParentForm.ColorLogOff;
            //                    if (expireDate > 0)
            //                        expirePW = string.Format("D+{0}", expireDate);
            //                    else
            //                        expirePW = string.Format("D{0}", expireDate);
            //                }
            //                else
            //                {
            //                    colorExpirePW = this.ParentForm.ColorLogOn;
            //                    expirePW = string.Format("D{0}", expireDate);
            //                }
            //            }
            //        }
            //        else
            //        {
            //            colorExpirePW = this.ParentForm.ColorLogOn;
            //            expirePW = "-";
            //        }
            //    }
            //    else
            //    {
            //        // Part11 미사용
            //        colorExpirePW = this.ParentForm.ColorLogOn;
            //        expirePW = "-";
            //    }
            //}


            if (this.ParentForm.SystemConfig.IsOptPart11 == true)
            {
                if (user.ExpirePassword != 0)
                {
                    expireDate = user.GetPasswordExpiryDday();
                    colorExpirePW = this.ParentForm.ColorLogOn;
                    expirePW = "-";

                    if (expireDate < 9999)
                    {
                        if (expireDate >= -10)
                        {
                            colorExpirePW = this.ParentForm.ColorLogOff;
                            if (expireDate > 0)
                                expirePW = string.Format("D+{0}", expireDate);
                            else
                                expirePW = string.Format("D{0}", expireDate);
                        }
                        else
                        {
                            colorExpirePW = this.ParentForm.ColorLogOn;
                            expirePW = string.Format("D{0}", expireDate);
                        }
                    }
                }
            }

            if (this.labelUserID.Text != id)
                this.labelUserID.Text = id;
            if (this.labelUserLevel.Text != group)
                this.labelUserLevel.Text = group;
            if (this.labelExpireOfPassword.ForeColor != colorExpirePW)
                this.labelExpireOfPassword.ForeColor = colorExpirePW;
            if (this.labelExpireOfPassword.Text != expirePW)
                this.labelExpireOfPassword.Text = expirePW;
        }

        public void DisplayRefresh()
        {
            if(this.ParentForm.SystemConfig.IsLogin == false)
                this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.NotLogin;

            this.UpdateDisplayMenuAccess(this.ParentForm.SystemConfig.CurrentUser);

            this.ParentForm.TransferData(CommunicationCommand.ModeNormal, CommunicationID.MainBoard);
            this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormMenu;
        }
        #endregion

        #region Override Member
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

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

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

            if (button == null)
                return;

            if (button == this.buttonTimeSetting)
            {
                #region 시간설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormTimeSetting);
                this.ParentForm.ChildFormTimeSetting.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonInformation)
            {
                #region 시스템정보
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormInformation);
                this.ParentForm.ChildFormInformation.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonDataBackup)
            {
                #region 데이터백업
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormDataBackup);
                if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                    this.ParentForm.ChildFormDataBackup_Part11.DisplayRefresh();
                else
                    this.ParentForm.ChildFormDataBackup.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonSysConfig)
            {
                #region 시스템설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormSystemSetting);
                this.ParentForm.ChildFormSystemSetting.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonCalibration)
            {
                #region 중량조정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormCalibration);
                this.ParentForm.ChildFormCalibration.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonConfiguration)
            {
                #region 환경설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormConfiguration);
                this.ParentForm.ChildFormConfiguration.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonMotorSetting)
            {
                #region 모터설정
                this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._1104_ImpellerMotorIndividualDirection, "");

                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMotorSetting);
                this.ParentForm.ChildFormMotorSetting.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonFactoryInitialize)
            {
                #region 공장초기화
                DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig.Language, 5);
                if (myDlg.ShowDialog() == DialogResult.Yes)
                {
                    // Part 11
                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Initialization, "");

                    ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormFactory);
                    this.ParentForm.ChildFormFactoryInitialize.timer1.Enabled = true;
                }
                #endregion
            }
            else if (button == this.buttonUpdate)
            {
                #region 업데이트
                DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig.Language, 3);
                if (myDlg.ShowDialog() == DialogResult.Yes)
                {
                    // Part 11
                    if (this.ParentForm.SystemConfig.IsOptPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingOperation.Update, "");

                    this.ParentForm.ChildFormProgramUpdate.DisplayRefresh();
                }
                #endregion
            }
            else if (button == this.buttonEquipmentSetting)
            {
                #region 장비설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormEquipmentSetting);
                this.ParentForm.ChildFormEquipmentSetting.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonIOTest)
            {
                #region IO테스트
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormIOTest);
                this.ParentForm.ChildFormIOTest.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonEquipmentTest)
            {
                #region 장비테스트
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormEquipmentTest);
                this.ParentForm.ChildFormEquipmentTest.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonUser)
            {
                #region 유저설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormUserEditor);
                this.ParentForm.ChildFormUserEditor.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonDataStatistics)
            {
                #region 데이터통계
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormDataStatistics);
                this.ParentForm.ChildFormDataStatistics.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonOptionSetting)
            {
                #region 옵션설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormOptionSetting);
                this.ParentForm.ChildFormOptionSetting.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonCommunication)
            {
                #region 통신설정
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormCommunication);
                this.ParentForm.ChildFormCommunication.DisplayRefresh();
                #endregion
            }
            else if (button == this.buttonDataViewer)
            {
                #region 데이터뷰어
                ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormDataViewer);
                this.ParentForm.ChildFormDataViewer.DisplayRefresh();
                #endregion
            }
        }
        private void buttonBack_Click(object sender, EventArgs e)
        {
            this.ParentForm.ChildFormMainDisplay.DisplayRefresh();
            ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMainDisplay);
        }
        private void buttonFunction_Click(object sender, EventArgs e)
        {
            if (this.ParentForm.SystemConfig.IsLogin == false)
            {
                DialogFormPasswordKeyPad1 password = new DialogFormPasswordKeyPad1(8, this.ParentForm.SystemConfig.Language);
                DialogResult dialogResult = password.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    this.ParentForm.SystemConfig.CurrentUser.Group = DataStore.UserGroup.Developer;
                    this.UpdateDisplayMenuAccess(this.ParentForm.SystemConfig.CurrentUser);
                }
            }
            else
            {
                if (this.ParentForm.SystemConfig.CurrentUser.Group == DataStore.UserGroup.Developer)
                {
                    if (this.buttonEquipmentTest.Visible != true)
                        this.buttonEquipmentTest.Visible = true;
                    if (this.buttonOptionSetting.Visible != true)
                        this.buttonOptionSetting.Visible = true;
                }
            }
        }
        #endregion
    }
}