コード例 #1
0
        public static bool isNormative(DictionaryBookSeller bookseller, ref List <string> errorMsg)
        {
            List <string> errorList = new List <string>();

            if (bookseller.Id <= 0)
            {
                errorList.Add("BookSellerId Error");
            }
            Match matchCallNumber = Regex.Match(bookseller.CallNumber, @"^(\d{1,10})$");

            if (!matchCallNumber.Success)
            {
                errorList.Add("CallNumber Error");
            }
            Match matchPostCodes = Regex.Match(bookseller.PostCodes.ToString(), @"^(\d{5,6})$");

            if (!matchPostCodes.Success)
            {
                errorList.Add("CallNumber Error");
            }
            if (errorList.Count > 0)
            {
                return(true);
            }
            return(false);
        }
コード例 #2
0
 /// <summary>
 /// 判断是否有空值
 /// </summary>
 /// <param name="bookseller">书商字典项</param>
 /// <returns></returns>
 public static bool isNull(DictionaryBookSeller bookseller)
 {
     if (bookseller.BookSeller == "")
     {
         return(true);
     }
     if (bookseller.Location == "")
     {
         return(true);
     }
     if (bookseller.Contact == "")
     {
         return(true);
     }
     if (bookseller.CallNumber == "")
     {
         return(true);
     }
     if (bookseller.PostCodes == 0)
     {
         return(true);
     }
     if (bookseller.BankName == "")
     {
         return(true);
     }
     return(false);
 }