Esempio n. 1
0
    /// <summary>
    /// 畫面檢核
    /// </summary>
    /// <param name="msg">檢核失敗訊息</param>
    /// <returns>bool</returns>
    private bool viewValidation(out string msg)
    {
        bool result = true;

        msg = "";
        List <string> sb = new List <string>();

        if (!string.IsNullOrEmpty(txtOTCompID.Text))
        {
            if (ValidationUtility.IsAnyOneChineseWord(txtOTCompID.Text) || ValidationUtility.IsAnyOneFullWidthWord(txtOTCompID.Text))
            {
                sb.Add("公司欄位請勿輸入全形字或中文!!");
                result = false;
            }
        }
        if (!string.IsNullOrEmpty(txtOTEmpID.Text))
        {
            if (!ValidationUtility.IsAllNumber(txtOTEmpID.Text))
            {
                sb.Add("員編欄位只能輸入數字!!");
                result = false;
            }
        }
        if (sb.Count > 0)
        {
            msg = string.Join("\n", sb);
        }
        return(result);
    }