using ManualSoftwareSystem.Inspection_Work;
using ManualSoftwareSystem.Operation_Manual;
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 ManualSoftwareSystem
{
    public partial class FrmInspectionWorkSelectMode : Form
    {
        public dynamic objLanguage;

        public FrmInspectionWorkSelectMode()
        {
            InitializeComponent();
            this.objLanguage = FrmOperationManualOperator.objLanguage;
        }

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

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rbnSelectInspectionWork.Checked == true)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                //openFileDialog1.Filter = "Master file (*.003)|*.003|Working (*.000)|*.000";
                openFileDialog1.Filter = objLanguage.Translate("Working") + " (*.000)|*.000";
                DialogResult result = openFileDialog1.ShowDialog();

                if (result == DialogResult.OK)
                {


                    FrmConfirmationPage frmConfirmationPage = new FrmConfirmationPage(openFileDialog1.FileName);

                    this.Dispose();

                    frmConfirmationPage.ShowDialog();


                }
            }
            else if (rbnCreateInspectionTable.Checked == true)
            {
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                //openFileDialog1.Filter = "Master file (*.003)|*.003|Working (*.000)|*.000";
                openFileDialog1.Filter = objLanguage.Translate("Master file") + " (*.003)|*.003";
                DialogResult result = openFileDialog1.ShowDialog();

                if (result == DialogResult.OK)
                {

                    FrmInspectionWorkInput frmInspectionWorkInput = new FrmInspectionWorkInput(openFileDialog1.FileName);
                    this.Dispose();
                    frmInspectionWorkInput.ShowDialog();


                }
            }
        }

        private void FrmInspectionWorkSelectMode_Load(object sender, EventArgs e)
        {
            string strConfirmation = "Confirmation";
            string strOK = "OK";
            string strCancel = "Cancel";
            //string strSelecting = "Selecting an inspection executable";
            string strSelecting = "Selecting an inspection master file";
            string strSelectInspectionWork = "Select the inspection work  it is working on.";
            //string strCreateInspectionTable = "Create an inspection table from the master and then\r\nImplement it.";
            string strCreateInspectionTable = "Create an inspection work from the master.";

            lblConfirmation.Text = objLanguage.Translate(strConfirmation);
            btnOK.Text = objLanguage.Translate(strOK);
            btnCancel.Text = objLanguage.Translate(strCancel);
            lblSelecting.Text = objLanguage.Translate(strSelecting);
            rbnSelectInspectionWork.Text = objLanguage.Translate(strSelectInspectionWork);
            rbnCreateInspectionTable.Text = objLanguage.Translate(strCreateInspectionTable);

        }
    }
}
