Esempio n. 1
0
        /// <summary>
        /// 领取教材的数量
        /// </summary>
        /// <param name="textbookId"></param>
        /// <returns></returns>
        public int ReleaseCount(Guid textbookId)
        {
            var records = ReleaseRecords.Where(t => t.Textbook_Id == textbookId);

            if (records == null || records.Count() == 0)
            {
                return(0);
            }
            else
            {
                var count = records.Sum(t => t.ReleaseCount);
                return(count);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 是否领过教材
        /// </summary>
        /// <param name="textbook"></param>
        /// <returns></returns>
        public bool HasTextbook(Guid textbookId)
        {
            var result = ReleaseRecords.FirstOrDefault(t => t.Textbook_Id == textbookId);

            return(result == null ? false : true);
        }