private bool DateRangeCheck(string from, string to, string field)
        {
            if (!CheckUtility.SearchConditionCheck(this, field, from, false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, field, to, false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if ((!string.IsNullOrEmpty(from)) || (!string.IsNullOrEmpty(to)))
            {
                if (!CheckUtility.DateRationalCheck(from, to))
                {
                    MetroMessageBox.Show(this, "\n" + string.Format(JimugoMessages.E000ZZ045, string.IsNullOrEmpty(from) ? "日付(From)" : from, to), "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return(false);
                }
            }

            return(true);
        }
        private bool ValidateInputs()
        {
            //validate

            if (!CheckUtility.SearchConditionCheck(this, lblCompanNoBox.Text, txtCompanyNoBox.Text.Trim(), true, Utility.DataType.HALF_ALPHA_NUMERIC, 10, 10))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblEDIAccount.Text, txtEDIAccount.Text.Trim(), false, Utility.DataType.EDI_ACCOUNT, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblCompanyName.Text, txtCompanyName.Text.Trim(), false, Utility.DataType.FULL_WIDTH, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblIssueDate.Text, txtIssueDate.Text.Trim(), false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblOrderDate.Text, txtOrderDate.Text.Trim(), false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblNotificationDate.Text, txtNotificationDate.Text.Trim(), false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblTax.Text, txtTax.Text.Trim(), true, Utility.DataType.HALF_NUMBER, 2, 1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblQuotationStartDate.Text, txtQuotationStartDate.Text.Trim(), chkMonthlyQuote.Checked, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblQuotationExpireDay.Text, txtQuotationExpireDay.Text.Trim(), true, Utility.DataType.HALF_NUMBER, 3, 1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblInitialSpecialDiscount.Text, txtInitialSpecialDiscount.Text.Trim(), false, Utility.DataType.HALF_NUMBER, 7, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblMonthlySpecialDiscount.Text, txtMonthlySpecialDiscount.Text.Trim(), false, Utility.DataType.HALF_NUMBER, 7, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblYearlySpecialDiscount.Text, txtYearlySpecialDiscount.Text.Trim(), false, Utility.DataType.HALF_NUMBER, 7, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblDestinationEmail.Text, txtDestinationMail.Text.Trim(), true, Utility.DataType.EMAIL, 255, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblPeriod.Text, txtPeriodFrom.Text.Trim(), CONTRACT_PLAN == "PRODUCT" ? true : false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, lblPeriod.Text, txtPeriodTo.Text.Trim(), CONTRACT_PLAN == "PRODUCT" ? true : false, Utility.DataType.DATE, -1, -1))
            {
                return(false);
            }
            if (!CheckUtility.DateRationalCheck(txtPeriodFrom.Text.Trim(), txtPeriodTo.Text.Trim()))
            {
                MetroMessageBox.Show(this, "\n" + JimugoMessages.I000WB004, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[0].Text, txtInitialRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[1].Text, txtMonthlyRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[2].Text, txtOrderRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[3].Text, txtProductionInfoRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            //checkboxes check message ?
            bool atLeastOneChecked = false;

            if (chkMonthlyQuote.Checked)
            {
                atLeastOneChecked = true;
            }

            if (chkInitialQuot.Checked)
            {
                atLeastOneChecked = true;
            }

            if (chkProductionInfo.Checked)
            {
                atLeastOneChecked = true;
            }

            if (chkOrderForm.Checked)
            {
                atLeastOneChecked = true;
            }
            if (!atLeastOneChecked)
            {
                MetroMessageBox.Show(this, "\n" + "少なくとも1つの帳票タイプをチェックしてください。", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (!string.IsNullOrEmpty(txtInitialSpecialDiscount.Text.Trim()))
            {
                bool OneChecked = false;

                if (chkInitialQuot.Checked)
                {
                    OneChecked = true;
                }

                if (chkProductionInfo.Checked)
                {
                    OneChecked = true;
                }

                if (chkOrderForm.Checked)
                {
                    OneChecked = true;
                }

                if (!OneChecked)
                {
                    MetroMessageBox.Show(this, "\n" + string.Format(JimugoMessages.E000WB035, "特別値引き額(初期)", "初期見積書、生産情報閲覧、注文書"), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[0].Text, txtInitialRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[1].Text, txtMonthlyRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[2].Text, txtOrderRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            if (!CheckUtility.SearchConditionCheck(this, tbParent.TabPages[3].Text, txtProductionInfoRemark.Text.Trim(), false, Utility.DataType.TEXT, 500, 0))
            {
                return(false);
            }

            return(true);
        }