Exemplo n.º 1
0
        /// <summary>
        /// 从数据库获取所有意见列表
        /// </summary>
        /// <returns></returns>
        private List <Tuple <string, string, int, int, List <string> > > getAllListByDb()
        {
            var     comments  = GetAll();
            DeptBLL borganize = new DeptBLL();
            List <Tuple <string, string, int, int, List <string> > > list = new List <Tuple <string, string, int, int, List <string> > >();

            foreach (var comment in comments)
            {
                List <string> userList = new List <string>();
                if (!comment.MemberID.IsNullOrEmpty())
                {
                    var users = borganize.GetAllUsers(comment.MemberID);
                    foreach (var user in users)
                    {
                        userList.Add(user.ID);
                    }
                }

                Tuple <string, string, int, int, List <string> > tuple = new Tuple <string, string, int, int, List <string> >(
                    comment.ID,
                    comment.Comment,
                    comment.Type,
                    comment.Sort,
                    userList
                    );
                list.Add(tuple);
            }
            return(list);
        }