//20130708から追加
        //ユーザ検索
        protected AggregateBase SearchUserAll(ParamList param)
        {
            Console.WriteLine("this is SearchUser method of DBTableAccess");
            AggregateBase aggregate = null;
            String        query     = "select * from users";

            List <List <string> > dataList = new List <List <string> >();
            DataSet dataset = ((DBSqlServer)db).QuerySelect(query, "users");

            for (int i = 0; i < dataset.Tables["users"].Rows.Count; i++)
            {
                String rowColumn0 = dataset.Tables["users"].Rows[i][0].ToString().Trim();
                String rowColumn1 = dataset.Tables["users"].Rows[i][1].ToString().Trim();
                //Console.WriteLine("this is DBTableAccess: " + rowColumn);
                List <String> item = new List <string>();
                item.Add(rowColumn0);
                item.Add(rowColumn1);
                dataList.Add(item);
            }

            for (int j = 0; j < dataList.Count; j++)
            {
                for (int k = 0; k < 2; k++)
                {
                    Console.Write("this is DBTableAccess: " + dataList[j][k].ToString() + "  ");
                    Console.WriteLine(dataList[j][k].ToString());
                }
            }

            aggregate = new AggregateUser(dataList);

            return(aggregate);
        }
Exemple #2
0
        public override void Run()
        {
            Console.WriteLine("ServiceSearchUser Run");
            DataAccessInterface dataAccess = new DBTableAccess();
            AggregateUser       aggregate  = (AggregateUser)dataAccess.Search(DataAccessInterface.SearchPattern.Users, param);

            Console.WriteLine("this is size of Run method in Service class: " + aggregate.Size());
            //IteratorUser iu = (IteratorUser)aggregate.Iterator();
            //while (iu.HasNext())
            //{
            //    DataListUser dlu = (DataListUser)iu.Next();
            //    Console.WriteLine("this is Iterator in Run Method: " + dlu.UserName());
            //}
            TypeUserAggregate userInfo = new TypeUserAggregate(aggregate);

            param.SetParam(userInfo);
        }
 public IteratorUser(AggregateUser userInfo)
 {
     this.userInfo = userInfo;
 }