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;

namespace INT51DB.DialogForms
{
    public partial class DialogFormYesNo : Form
    {
        #region Field

        #endregion

        #region Constructor
        public DialogFormYesNo()
        {
            InitializeComponent();
        }

        public DialogFormYesNo(DataStore.LanguageID language, int ok)
        {
            InitializeComponent();

            if (language == DataStore.LanguageID.Korean)
            {
                switch (ok)
                {
                    case 1:
                        this.labelErrorCode.Text = "";
                        this.labelMessage.Text = "예전 DLL로 되돌리시겠습니까?";
                        break;
                    case 2:
                        this.labelErrorCode.Text = "";
                        this.labelMessage.Text = "언어를 변경하시겠습니까?";
                        break;
                    case 3:
                        this.labelErrorCode.Text = "업데이트";
                        this.labelMessage.Text = "새 버전으로 업데이트됩니다.";
                        break;
                    case 4:
                        this.labelErrorCode.Text = "스타일러스";
                        this.labelMessage.Text = "화면 보정을 실행하시겠습니까?";
                        break;
                    case 5:
                        this.labelErrorCode.Text = "공장초기화";
                        this.labelMessage.Text = "설정된 모든 데이터가 초기화됩니다.";
                        break;
                    case 6:
                        this.labelErrorCode.Text = "LCD초기화";
                        this.labelMessage.Text = "LCD에 설정된 데이터가 초기화됩니다.";
                        break;
                    case 7:
                        this.labelErrorCode.Text = "메인보드초기화";
                        this.labelMessage.Text = "메인보드에 설정된 데이터가 초기화됩니다.";
                        break;
                    case 8:
                        this.labelErrorCode.Text = "소거";
                        this.labelMessage.Text = "카운트 값을 소거 하시겠습니까?";
                        break;
                    case 9:
                        this.labelErrorCode.Text = "모터 다운로드";
                        this.labelMessage.Text = "현재 값을 다운로드 하시겠습니까?";
                        break;
                    case 10:
                        this.labelErrorCode.Text = "모터 다운로드";
                        this.labelMessage.Text = "새 모터에 다운로드 하시겠습니까?";
                        break;
                    case 11:
                        this.labelErrorCode.Text = "모터 다운로드";
                        this.labelMessage.Text = "현재 라인번호로 변경하시겠습니까?";
                        break;
                    case 12:
                        this.labelErrorCode.Text = "로그인";
                        this.labelMessage.Text = "Log Off 하시겠습니까?";
                        break;
                    case 13:
                        this.labelErrorCode.Text = "컨베어";
                        this.labelMessage.Text = "컨베어 다운 위치로 이동 하시겠습니까?";
                        break;
                    case 14:
                        this.labelErrorCode.Text = "컨베어";
                        this.labelMessage.Text = "컨베어 UP1 위치로 이동 하시겠습니까?";
                        break;
                    case 15:
                        this.labelErrorCode.Text = "컨베어";
                        this.labelMessage.Text = "컨베어 UP2 위치로 이동 하시겠습니까?";
                        break;
                    default:
                        break;
                }
            }
            else if (language == DataStore.LanguageID.English)
            {
                switch (ok)
                {
                    case 1:
                        this.labelErrorCode.Text = "";
                        this.labelMessage.Text = "Do you want to revert to the previous DLL?";
                        break;
                    case 2:
                        this.labelErrorCode.Text = "";
                        this.labelMessage.Text = "Do you change the language?";
                        break;
                    case 3:
                        this.labelErrorCode.Text = "Update";
                        this.labelMessage.Text = "Now appilcation program update";
                        break;
                    case 4:
                        this.labelErrorCode.Text = "Stylus";
                        this.labelMessage.Text = "To re-calibrate the screen, press the YES button.";
                        break;
                    case 5:
                        this.labelErrorCode.Text = "Initialization";
                        this.labelMessage.Text = "All datas will be initialized";
                        break;
                    case 6:
                        this.labelErrorCode.Text = "LCD Initialization";
                        this.labelMessage.Text = "All datas in LCD will be initialized";
                        break;
                    case 7:
                        this.labelErrorCode.Text = "Mainboard Initialization";
                        this.labelMessage.Text = "All datas in Mainboard will be initialized";
                        break;
                    case 8:
                        this.labelErrorCode.Text = "Clear";
                        this.labelMessage.Text = "Erase all count?";
                        break;
                    case 9:
                        this.labelErrorCode.Text = "Motor download";
                        this.labelMessage.Text = "Do you want to download the current value?";
                        break;
                    case 10:
                        this.labelErrorCode.Text = "Motor download";
                        this.labelMessage.Text = "Do you want to download the new motor?";
                        break;
                    case 11:
                        this.labelErrorCode.Text = "Motor download";
                        this.labelMessage.Text = "Do you want to change with the device number to current line?";
                        break;
                    case 12:
                        this.labelErrorCode.Text = "Login";
                        this.labelMessage.Text = "Do you want to log off?";
                        break;
                    case 13:
                        this.labelErrorCode.Text = "Conveyor";
                        this.labelMessage.Text = "Move to conveyor down location?";
                        break;
                    case 14:
                        this.labelErrorCode.Text = "Conveyor";
                        this.labelMessage.Text = "Move to conveyor UP1 position?";
                        break;
                    case 15:
                        this.labelErrorCode.Text = "Conveyor";
                        this.labelMessage.Text = "Move to conveyor UP2 position?";
                        break;
                    default:
                        break;
                }
            }
            else if (language == DataStore.LanguageID.Chinese)
            {
            }
            else if (language == DataStore.LanguageID.Czech)
            {
            }
            else
            { 
            }
        }
        #endregion

        #region Property

        #endregion

        #region Method
        private void InitializeContnrol()
        {
            int x = 0, y = 0;

            x = Screen.PrimaryScreen.Bounds.Width / 2 - this.Size.Width / 2;
            y = Screen.PrimaryScreen.Bounds.Height / 2 - this.Size.Height / 2;

            this.Location = new Point(x, y);
        }
        #endregion

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

            this.InitializeContnrol();
        }
        #endregion

        #region Event Handler
        private void buttonYes_Click(object sender, EventArgs e)
        {
            this.Close();

            this.DialogResult = DialogResult.Yes;
        }

        private void buttonNo_Click(object sender, EventArgs e)
        {
            this.Close();

            this.DialogResult = DialogResult.No;
        }
        #endregion
    }
}