public void Clear()
 {
     txtPayPlanDate.Text    = string.Empty;
     txtPayeeCD.Text        = string.Empty;
     lblVendorName.Text     = string.Empty;
     lblPayGaku1.Text       = string.Empty;
     txtTransferAmount.Text = string.Empty;
     SC_BankCD.Clear();
     SC_BranchCD.Clear();
     txtKouzaKBN.Text           = string.Empty;
     txtAccNo.Text              = string.Empty;
     txtMeigi.Text              = string.Empty;
     txtFeeKBN.Text             = string.Empty;
     txtAmount.Text             = string.Empty;
     txtCash.Text               = string.Empty;
     txtOffsetGaku.Text         = string.Empty;
     txtBill.Text               = string.Empty;
     txtBillNo.Text             = string.Empty;
     txtBillDate.Text           = string.Empty;
     txtElectronicBone.Text     = string.Empty;
     txtElectronicRecordNo.Text = string.Empty;
     txtSettlementDate2.Text    = string.Empty;
     txtOther1.Text             = string.Empty;
     SC_HanyouKeyStart1.Clear();
     SC_HanyouKeyStart2.Clear();
     txtOther2.Text = string.Empty;
     SC_HanyouKeyEnd1.Clear();
     SC_HanyouKeyEnd2.Clear();
 }
 private void SC_HanyouKeyStart1_CodeKeyDownEvent(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (!string.IsNullOrWhiteSpace(SC_HanyouKeyStart1.TxtCode.Text))
         {
             if (!SC_HanyouKeyStart1.SelectData())
             {
                 bbl.ShowMessage("E101");
                 SC_HanyouKeyStart1.SetFocus(1);
             }
             else
             {
                 SC_HanyouKeyStart1.Value1 = dtIDName1.Rows[0]["ID"].ToString();
                 SC_HanyouKeyStart1.Value2 = dtIDName1.Rows[0]["IDName"].ToString();
             }
         }
     }
 }
        /// <summary>
        /// Error Check of F12
        /// </summary>
        /// <returns></returns>
        public bool ErrorCheck()
        {
            if (Convert.ToInt32(txtTransferAmount.Text) > 0)
            {
                if (!RequireCheck(new Control[] { SC_BankCD.TxtCode }))
                {
                    return(false);
                }

                SC_BankCD.ChangeDate = DateTime.Today.ToShortDateString();
                if (!SC_BankCD.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_BankCD.SetFocus(1);
                    return(false);
                }

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

                SC_BranchCD.ChangeDate = DateTime.Today.ToShortDateString();
                SC_BranchCD.Value1     = SC_BankCD.TxtCode.Text;
                if (!SC_BranchCD.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_BranchCD.SetFocus(1);
                    return(false);
                }

                if (!RequireCheck(new Control[] { txtKouzaKBN }))
                {
                    return(false);
                }
                //if (!txtKouzaKBN.Text.Equals("1") || !txtKouzaKBN.Text.Equals("2"))
                //{
                //    bbl.ShowMessage("E101");
                //    txtKouzaKBN.Focus();
                //    return false;
                //}
                if (txtKouzaKBN.Text != "1")
                {
                    if (txtKouzaKBN.Text != "2")
                    {
                        bbl.ShowMessage("E101");
                        txtKouzaKBN.Focus();
                        return(false);
                    }
                }

                if (!RequireCheck(new Control[] { txtAccNo, txtMeigi, txtFeeKBN }))
                {
                    return(false);
                }
                //if (!txtFeeKBN.Text.Equals("1") || !txtFeeKBN.Text.Equals("2"))
                //{
                //    bbl.ShowMessage("E101");
                //    txtFeeKBN.Focus();
                //    return false;
                //}

                if (!txtFeeKBN.Text.Equals("1"))
                {
                    if (!txtFeeKBN.Text.Equals("2"))
                    {
                        bbl.ShowMessage("E101");
                        txtFeeKBN.Focus();
                        return(false);
                    }
                }

                if (!RequireCheck(new Control[] { txtAmount }))
                {
                    return(false);
                }
            }

            if (Convert.ToInt32(txtBill.Text) > 0)
            {
                if (!RequireCheck(new Control[] { txtBillNo, txtBillDate }))
                {
                    return(false);
                }
            }

            if (Convert.ToInt32(txtElectronicBone.Text) > 0)
            {
                if (!RequireCheck(new Control[] { txtElectronicRecordNo, txtSettlementDate2 }))
                {
                    return(false);
                }
            }

            if (Convert.ToInt32(txtOther1.Text) > 0)
            {
                if (!RequireCheck(new Control[] { SC_HanyouKeyStart1.TxtCode }))
                {
                    return(false);
                }

                if (!SC_HanyouKeyStart1.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_HanyouKeyStart1.SetFocus(1);
                    return(false);
                }

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

                if (!SC_HanyouKeyEnd1.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_HanyouKeyEnd1.SetFocus(1);
                    return(false);
                }
            }

            if (Convert.ToInt32(txtOther2.Text) > 0)
            {
                if (!RequireCheck(new Control[] { SC_HanyouKeyStart2.TxtCode }))
                {
                    return(false);
                }
                if (!SC_HanyouKeyStart2.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_HanyouKeyStart2.SetFocus(1);
                    return(false);
                }

                if (!RequireCheck(new Control[] { SC_HanyouKeyEnd2.TxtCode }))
                {
                    return(false);
                }
                if (!SC_HanyouKeyEnd2.IsExists(2))
                {
                    bbl.ShowMessage("E101");
                    SC_HanyouKeyEnd2.SetFocus(1);
                    return(false);
                }
            }

            return(true);
        }