Esempio n. 1
0
 /// <summary>
 /// 判断编目记录是否有空项
 /// </summary>
 /// <param name="list">待判断登到记录</param>
 /// <returns>是否有空项</returns>
 public static bool isNull(InterviewCatalog list)
 {
     if (list.InterviewId == 0)
     {
         return(true);
     }
     if (list.State == "")
     {
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// 判断采访记录是否规范
        /// </summary>
        /// <param name="list">待判断采访记录</param>
        /// <param name="errorMsg">错误信息</param>
        /// <returns>是否规范</returns>
        public static bool isNormative(InterviewCatalog list, ref List <string> errorMsg)
        {
            List <string> errorList = new List <string>();

            if (list.InterviewId <= 0)
            {
                errorList.Add("InterviewId Error");
            }
            Match matchState = Regex.Match(list.State, @"^(可编目|退回|已入表)$");

            if (!matchState.Success)
            {
                errorList.Add("State Error");
            }
            errorMsg = errorList;
            if (errorList.Count > 0)
            {
                return(false);
            }
            return(true);
        }