public long InsertInfo(ClcddmInfo info) { info.ValidFlag = true; ///校验 ValidInfo(info); return(dal.Add(info)); }
private void ValidInfo(ClcddmInfo info) { ///代码不允许重复 int cnt = dal.GetCounts("and ([DM] = '" + info.Dm + "' or [MC] = '" + info.Mc + "') and [VALID_FLAG] = 1"); if (cnt > 0) { throw new Exception("代码不允许重复"); } }