コード例 #1
0
        public void Create(String Category, String Date, int Amount, String Remark)
        {
            Guid     Id = Guid.NewGuid();
            int      Categoryyy;
            DateTime Dateee;
            String   Remarkkk;

            if (Remark == "" || Remark == null)
            {
                Remarkkk = "test";
            }
            else
            {
                Remarkkk = Remark;
            }

            if (Category == "收入")
            {
                Categoryyy = 0;
            }
            else
            {
                Categoryyy = 1;
            }

            Dateee = DateTime.ParseExact(Date, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.AllowWhiteSpaces);

            AccountBookRepository _CreateData = new AccountBookRepository();

            _CreateData.Create(Id, Categoryyy, Dateee, Amount, Remarkkk);
        }
コード例 #2
0
        public void Delete(int order)
        {
            AccountBookRepository _DeleteData = new AccountBookRepository();

            //因ViewModel的No原始設計為int,因此Guid類型的Id不與其他資料一起存在ViewModel
            List <Guid> GuidList = new List <Guid>();

            var  result = _DeleteData.GetAllGuid();
            int  len    = result.Count();
            Guid Id;

            for (int i = 0; i < len; i++)
            {
                Id = result[i].Id;
                GuidList.Add(Id);
            }

            Guid _Id = GuidList[order];

            _DeleteData.Delete(_Id);
        }
コード例 #3
0
 public AccountBookService()
 {
     __hmw          = new HomeworkModel();
     accountBookRes = new AccountBookRepository(__hmw);
 }