using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SystemX.Product.CP.TRA;

namespace SystemX.Product.TRA.UIControl
{
    public enum eContents
    {
        None,
        HostUseHistory,
        Overview,
        DetailOverview,
        TestHistory,
        NgHistory,
        ProductHistory,
        TestResult,
        TestSumamry,
        TestTrend
    }

    public enum eDataView
    {
        C1,
        C2
    }


    public partial class UcTRABaseView : UserControl
    {
        public UcTRABaseView()
        {
            InitializeComponent();
        }

        public string ViewID { get; set; }

        public eContents ContentsType { get; protected set; }

        public eDataView DataViewType { get; protected set; }

        virtual public void ExportData() { }

        protected void SetMenuFindErrorEnabled(bool bEnabled)
        {
            ToolStripMenuItemFindError.Enabled = bEnabled;
        }

        protected void SetMenuEnabled(eContents GeteContents)
        {
            switch(GeteContents)
            {
                case eContents.HostUseHistory:
                    ToolStripMenuItemOverview.Visible = false;
                    ToolStripMenuItemOverview.Enabled = false;

                    ToolStripMenuItemDetailOverview.Visible = false;
                    ToolStripMenuItemDetailOverview.Enabled = false;

                    ToolStripMenuItemHistory.Enabled = false;
                    ToolStripMenuItemOverview.Enabled = false;
                    ToolStripMenuItemSummary.Enabled = false;
                    ToolStripMenuItemDetail.Enabled = false;
                    ToolStripMenuItemFindError.Enabled = false;
                    //
                    toolStripSeparator2.Visible = false;
                    toolStripMenuItemExplorer.Visible = false;
                    toolStripMenuItemBeginRelDate.Enabled = false;
                    break;
                case eContents.Overview:
                    ToolStripMenuItemOverview.Visible = false;
                    ToolStripMenuItemOverview.Enabled = false;

                    ToolStripMenuItemDetailOverview.Visible = true;
                    ToolStripMenuItemDetailOverview.Enabled = true;

                    ToolStripMenuItemHistory.Enabled = false;
                    ToolStripMenuItemOverview.Enabled = false;
                    ToolStripMenuItemSummary.Enabled = false;
                    ToolStripMenuItemDetail.Enabled = false;
                    //ToolStripMenuItemFindError.Enabled = false;
                    //
                    toolStripSeparator2.Visible = false;
                    toolStripMenuItemExplorer.Visible = false;
                    toolStripMenuItemBeginRelDate.Enabled = false;
                    break;
                case eContents.DetailOverview:
                    ToolStripMenuItemOverview.Visible = true;
                    ToolStripMenuItemOverview.Enabled = true;

                    ToolStripMenuItemDetailOverview.Visible = false;
                    ToolStripMenuItemDetailOverview.Enabled = false;

                    ToolStripMenuItemSummary.Enabled = false;
                    ToolStripMenuItemDetail.Enabled = false;
                    break;
                case eContents.TestHistory:
                    ToolStripMenuItemOverview.Visible = true;
                    ToolStripMenuItemOverview.Enabled = true;

                    ToolStripMenuItemDetailOverview.Visible = true;
                    ToolStripMenuItemDetailOverview.Enabled = true;

                    ToolStripMenuItemHistory.Enabled = false;
                    ToolStripMenuItemFindError.Enabled = false;
                    //
                    toolStripSeparator2.Visible = false;
                    toolStripMenuItemExplorer.Visible = false;
                    toolStripMenuItemBeginRelDate.Enabled = false;
                    break;
            }
        }
    }
}
