public override void FunctionProcess(int index)
        {
            switch (index + 1)
            {
            case 2:
                ChangeMode(EOperationMode.INSERT);
                F12Visible = true;
                break;

            case 3:
                ChangeMode(EOperationMode.UPDATE);
                F12Visible = true;
                break;

            case 4:
                ChangeMode(EOperationMode.DELETE);
                F12Visible = true;
                break;

            case 5:
                ChangeMode(EOperationMode.SHOW);
                F12Visible = false;
                break;

            case 6:
                if (bbl.ShowMessage("Q004") == DialogResult.Yes)
                {
                    ChangeMode(OperationMode);
                    ScPaymentProcessNum.SetFocus(1);
                }
                else
                {
                    PreviousCtrl.Focus();
                }
                break;

            case 7:
                F7();
                break;

            case 11:
                F11();
                break;

            case 12:
                F12();
                break;
            }
        }
        private void ChangeMode(EOperationMode OperationMode)
        {
            base.OperationMode = OperationMode;
            switch (OperationMode)
            {
            case EOperationMode.INSERT:
                Clear(PanelHeader);
                Clear(PanelDetail);
                EnablePanel(PanelHeader);
                DisablePanel(PanelDetail);
                ScPaymentProcessNum.Enabled = false;
                ScPaymentNum.Enabled        = false;
                ScPayee.Enabled             = true;
                ScPayee.SearchEnable        = true;
                txtDueDate1.Focus();
                F9Visible          = false;
                F12Enable          = true;
                F11Enable          = true;
                btnF11Show.Enabled = true;
                //F11Visible = false;
                Clear();
                break;

            case EOperationMode.UPDATE:
            case EOperationMode.DELETE:
            case EOperationMode.SHOW:
                Clear(PanelHeader);
                Clear(PanelDetail);
                EnablePanel(PanelHeader);
                DisablePanel(PanelDetail);
                ScPaymentProcessNum.Enabled      = true;
                ScPaymentProcessNum.SearchEnable = true;
                ScPaymentNum.Enabled             = true;
                ScPaymentNum.SearchEnable        = true;
                ScPaymentProcessNum.SetFocus(1);
                txtDueDate1.Enabled  = false;
                txtDueDate2.Enabled  = false;
                ScPayee.Enabled      = false;
                ScPayee.SearchEnable = false;
                F12Enable            = true;
                F11Enable            = false;
                btnF11Show.Enabled   = F11Enable = false;
                //F11Visible = false;
                Clear();
                break;
            }
            ScPaymentProcessNum.SetFocus(1);
        }
        /// <summary>
        /// Error Check for the whole form
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        private bool ErrorCheck(int index)
        {
            if (index == 11)
            {
                if (type == 1)
                {
                    DataTable dtpay = new DataTable();
                    dpe.LargePayNO = ScPaymentProcessNum.TxtCode.Text;
                    dtpay          = sibl.D_Pay_LargePayNoSelect(dpe);
                    if (dtpay.Rows.Count == 0)
                    {
                        sibl.ShowMessage("E138");
                        ScPaymentProcessNum.SetFocus(1);
                        return(false);
                    }
                    else
                    {
                        if (!string.IsNullOrWhiteSpace(dtpay.Rows[0]["DeleteDateTime"].ToString()))
                        {
                            sibl.ShowMessage("E140");
                            ScPaymentProcessNum.SetFocus(1);
                            return(false);
                        }
                    }
                }

                else if (type == 2)
                {
                    if (!RequireCheck(new Control[] { ScPaymentNum.TxtCode }))
                    {
                        return(false);
                    }

                    DataTable dtpayno = new DataTable();
                    dpe.PayNo = ScPaymentNum.TxtCode.Text;
                    dtpayno   = sibl.D_Pay_PayNoSelect(dpe);
                    if (dtpayno.Rows.Count == 0)
                    {
                        sibl.ShowMessage("E138");
                        ScPaymentNum.SetFocus(1);
                        return(false);
                    }
                    else
                    {
                        if (!string.IsNullOrWhiteSpace(dtpayno.Rows[0]["DeleteDateTime"].ToString()))
                        {
                            sibl.ShowMessage("E140");
                            ScPaymentNum.SetFocus(1);
                            return(false);
                        }
                        if (!string.IsNullOrWhiteSpace(dtpayno.Rows[0]["FBCreateDate"].ToString()))
                        {
                            sibl.ShowMessage("E144");
                            ScPaymentNum.SetFocus(1);
                            return(false);
                        }
                        txtPaymentDate.Text         = dtpayno.Rows[0]["PayDate"].ToString();
                        mfye.InputPossibleStartDate = txtPaymentDate.Text;
                        mfye.InputPossibleEndDate   = txtPaymentDate.Text;
                        DataTable dtcontrol = new DataTable();
                        dtcontrol = sibl.M_Control_PaymentSelect(mfye);
                        if (dtcontrol.Rows.Count == 0)
                        {
                            sibl.ShowMessage("E115");
                            ScPaymentNum.SetFocus(1);
                            return(false);
                        }
                        //else
                        //{
                        //    DataDisplay();
                        //}
                    }
                }

                else if (type == 3)
                {
                    if (!RequireCheck(new Control[] { txtDueDate2 }))
                    {
                        return(false);
                    }
                    else
                    {
                        int result = txtDueDate1.Text.CompareTo(txtDueDate2.Text);
                        if (result > 0)
                        {
                            sibl.ShowMessage("E104");
                            txtDueDate2.Focus();
                        }
                    }

                    //if (!RequireCheck(new Control[] { ScPayee.TxtCode }))
                    //    return false;
                    //else
                    //if(!string.IsNullOrWhiteSpace(ScPayee.TxtCode.Text))
                    //{
                    mve.VendorCD      = ScPayee.TxtCode.Text;
                    mve.ChangeDate    = DateTime.Now.ToString("yyyy/MM/dd");
                    mve.MoneyPayeeFlg = "1";
                    DataTable dtvendor = new DataTable();
                    dtvendor = sibl.M_Vendor_Select(mve);
                    if (dtvendor.Rows.Count == 0)
                    {
                        sibl.ShowMessage("E101");
                        ScPayee.SetFocus(1);
                        return(false);
                    }
                    else
                    {
                        ScPayee.LabelText = dtvendor.Rows[0]["VendorName"].ToString();
                    }
                    //}
                }
            }
            else if (index == 12)
            {
                if (!RequireCheck(new Control[] { txtPaymentDate }))
                {
                    return(false);
                }

                mfye.InputPossibleStartDate = txtPaymentDate.Text;
                mfye.InputPossibleEndDate   = txtPaymentDate.Text;
                DataTable dtcontrol = new DataTable();
                dtcontrol = sibl.M_Control_PaymentSelect(mfye);
                if (dtcontrol.Rows.Count == 0)
                {
                    sibl.ShowMessage("E115");
                    ScPaymentNum.SetFocus(1);
                    return(false);
                }

                //店舗の締日チェック
                //店舗締マスターで判断
                M_StoreClose_Entity msce = new M_StoreClose_Entity();
                msce.StoreCD      = InOperatorCD;
                msce.FiscalYYYYMM = txtPaymentDate.Text.Replace("/", "").Substring(0, 6);
                DataTable dtposition = sibl.CheckClosePosition(msce);
                if (dtposition.Rows.Count > 0)
                {
                    if (dtposition.Rows[0]["ClosePosition2"].ToString() == "1")
                    {
                        sibl.ShowMessage("E203");
                        return(false);
                    }
                    else if (dtposition.Rows[0]["ClosePosition2"].ToString() == "2")
                    {
                        sibl.ShowMessage("E194");
                        return(false);
                    }
                }

                if (!RequireCheck(new Control[] { ScStaff.TxtCode }))
                {
                    return(false);
                }
                else
                {
                    mse.StaffCD    = ScStaff.TxtCode.Text;
                    mse.ChangeDate = txtPaymentDate.Text;
                    DataTable dtstaff = new DataTable();
                    dtstaff = sibl.M_Staff_Select(mse);
                    //if (!ScStaff.SelectData())
                    if (dtstaff.Rows.Count == 0)
                    {
                        sibl.ShowMessage("E101");
                        ScStaff.SetFocus(1);
                        return(false);
                    }
                    else
                    {
                        ScStaff.LabelText = dtstaff.Rows[0]["StaffName"].ToString();
                    }
                }

                //if (!RequireCheck(new Control[] {cboPaymentType}))
                if (string.IsNullOrWhiteSpace(cboPaymentType.SelectedValue.ToString()))
                {
                    sibl.ShowMessage("E102");
                    cboPaymentType.Focus();
                    return(false);
                }
                else
                {
                    mmpe.ID = "314";
                    DataTable dtmulti = new DataTable();
                    dtmulti = sibl.M_MultiPorpose_Select(mmpe);
                    if (dtmulti.Rows.Count == 0)
                    {
                        sibl.ShowMessage("E128");
                        cboPaymentType.Focus();
                        return(false);
                    }
                    else
                    {
                        string name = dtmulti.Rows[0]["Char1"].ToString();
                    }
                }

                if (string.IsNullOrWhiteSpace(cboPaymentSourceAcc.SelectedValue.ToString()))
                {
                    sibl.ShowMessage("E102");
                    cboPaymentSourceAcc.Focus();
                    return(false);
                }
                mke.ChangeDate = txtPaymentDate.Text;
                DataTable dtkouza = new DataTable();
                dtkouza = sibl.M_Kouza_SelectByDate(mke);
                if (dtkouza.Rows.Count == 0)
                {
                    sibl.ShowMessage("E128");
                    cboPaymentSourceAcc.Focus();
                    return(false);
                }
                else
                {
                    cboPaymentSourceAcc.SelectedValue = dtkouza.Rows[0]["KouzaCD"].ToString();
                }
                if (string.IsNullOrWhiteSpace(txtBillSettleDate.Text))
                {
                    sibl.ShowMessage("E102");
                    txtBillSettleDate.Focus();
                    return(false);
                }
            }

            return(true);
        }