private void ScStore_CodeKeyDownEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (!string.IsNullOrWhiteSpace(ScStore.Code))
         {
             DataTable dt = StoreData();
             if (!(dt.Rows.Count > 0))
             {
                 mstaffBL.ShowMessage("E101");
                 ScStore.SetFocus(1);
             }
             else
             {
                 if (dt.Rows[0]["DeleteFlg"].ToString() == "1")
                 {
                     mstaffBL.ShowMessage("E158");
                     ScStore.SetFocus(1);
                 }
                 else
                 {
                     storeKBN          = dt.Rows[0]["StoreKBN"].ToString();
                     ScStore.LabelText = dt.Rows[0]["StoreName"].ToString();
                 }
             }
         }
     }
 }
        private bool ErrorCheck(int index)
        {
            if (index == 11)
            {
                //HeaderCheck on F11
                if (OperationMode == EOperationMode.INSERT)
                {
                    if (type == 1)//New
                    {
                        if (!RequireCheck(new Control[] { ScStaff.TxtCode, ScStaff.TxtChangeDate }))
                        {
                            return(false);
                        }

                        if (ScStaff.IsExists(1))
                        {
                            mstaffBL.ShowMessage("E132");
                            ScStaff.SetFocus(1);
                            return(false);
                        }
                    }
                    else//Copy
                    {
                        if (!RequireCheck(new Control[] { ScStaff.TxtCode, ScStaff.TxtChangeDate }))
                        {
                            return(false);
                        }

                        if (!RequireCheck(new Control[] { ScStaffCopyCD.TxtCode }, ScStaffCopyCD.TxtChangeDate))
                        {
                            return(false);
                        }

                        if (!RequireCheck(new Control[] { ScStaffCopyCD.TxtChangeDate }, ScStaffCopyCD.TxtCode))
                        {
                            return(false);
                        }


                        if (!string.IsNullOrWhiteSpace(ScStaffCopyCD.TxtCode.Text) && !string.IsNullOrWhiteSpace(ScStaffCopyCD.ChangeDate))
                        {
                            if (!ScStaffCopyCD.IsExists(1))
                            {
                                mstaffBL.ShowMessage("E133");
                                ScStaffCopyCD.SetFocus(1);
                                return(false);
                            }
                        }
                    }
                }
                else
                {
                    if (!ScStaff.IsExists(1))
                    {
                        mstaffBL.ShowMessage("E133");
                        ScStaff.SetFocus(1);
                        return(false);
                    }
                }
            }
            else if (index == 12)
            {
                if (!RequireCheck(new Control[] { ScStaff.TxtCode, ScStaff.TxtChangeDate, txtStaffName, txtStaffKana, txtJoinDate, txtPassword, txtConfirm }))
                {
                    return(false);
                }

                if (OperationMode == EOperationMode.INSERT)
                {
                    if (ScStaff.IsExists(1))
                    {
                        //*** ShowMessage
                        mstaffBL.ShowMessage("E132");
                        ScStaff.SetFocus(1);
                        return(false);
                    }
                }

                if (!string.IsNullOrWhiteSpace(ScStore.Code))
                {
                    if (StoreData().Rows.Count < 0)
                    {
                        mstaffBL.ShowMessage("E101");
                        ScStore.Focus();
                        //txt.MoveNext = false;
                        return(false);
                    }

                    if (StoreData().Rows[0]["DeleteFlg"].ToString() == "1")
                    {
                        mstaffBL.ShowMessage("E158");
                        ScStore.SetFocus(1);
                        //txt.MoveNext = false;
                        return(false);
                    }

                    if (StoreData().Rows[0]["StoreKBN"].ToString() == "1")
                    {
                        if (!RequireCheck(new Control[] { txtReceiptPrint }))
                        {
                            return(false);
                        }
                    }
                }

                if (txtConfirm.Text != txtPassword.Text)
                {
                    mstaffBL.ShowMessage("E166");
                    txtConfirm.Focus();
                    return(false);
                }


                //*** Insert Other Error Check
            }
            return(true);
        }