public ActionResult ListAccountData() { #region 第一天測試資料綁定 //List<AccountViewModel> listdata = new List<AccountViewModel>(); ////use GUID HashCode random seed //Random rnd = new Random(Guid.NewGuid().GetHashCode()); ////create test 1000 count data //for (int i = 0; i < 1000; i++) //{ // int typevalue = rnd.Next(1, 3); // AccountViewModel objAccountData = new AccountViewModel // { // Type = typevalue == ((int)Type.收入) ? "收入" : "支出", // AccountDate = RandomAccountDate(rnd), // AmountMoney = rnd.Next(100, 500), // remark = RandomRemarks(rnd, typevalue) // }; // listdata.Add(objAccountData); //} #endregion var listdata = AccountBookService.GetAllAccountBook().Take(5); return(View(listdata)); }