예제 #1
0
 /// <summary>
 /// 更新-EF-DB
 /// </summary>
 /// <param name="newdata"></param>
 /// <param name="olddata"></param>
 public void Edit(AccountBook newdata, AccountBook olddata)
 {
     olddata.Categoryyy = newdata.Categoryyy;
     olddata.Amounttt   = newdata.Amounttt;
     olddata.Dateee     = newdata.Dateee;
     olddata.Remarkkk   = newdata.Remarkkk;
 }
예제 #2
0
        /// <summary>
        /// 新增-傳入 ViewModel 資料
        /// </summary>
        /// <param name="MoneyAdd"></param>
        public void Add(MoneyAddViewModels MoneyAdd)
        {
            var result = new AccountBook()
            {
                Categoryyy = MoneyAdd.Category,
                Amounttt   = MoneyAdd.Amount,
                Dateee     = MoneyAdd.BillingDate,
                Remarkkk   = MoneyAdd.Memo
            };

            Add(result);
        }
예제 #3
0
        /// <summary>
        /// 明細
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public MoneyAddViewModels Detail(AccountBook data)
        {
            var result = new MoneyAddViewModels()
            {
                Id          = data.Id,
                Category    = data.Categoryyy,
                Amount      = data.Amounttt,
                BillingDate = data.Dateee,
                Memo        = data.Remarkkk
            };

            return(result);
        }
예제 #4
0
        /// <summary>
        /// 編輯
        /// </summary>
        /// <param name="MoneyAdd"></param>
        /// <param name="olddata"></param>
        public void Edit(MoneyAddViewModels MoneyAdd, AccountBook olddata)
        {
            var newdata = new AccountBook()
            {
                Id         = MoneyAdd.Id,
                Categoryyy = MoneyAdd.Category,
                Amounttt   = MoneyAdd.Amount,
                Dateee     = MoneyAdd.BillingDate,
                Remarkkk   = MoneyAdd.Memo
            };

            Edit(newdata, olddata);
        }
예제 #5
0
 /// <summary>
 /// 刪除-EF-DB
 /// </summary>
 /// <param name="data"></param>
 public void Delete(AccountBook data)
 {
     _db.AccountBook.Remove(data);
 }
예제 #6
0
 /// <summary>
 /// 新增-EF-DB
 /// </summary>
 /// <param name="money"></param>
 public void Add(AccountBook data)
 {
     data.Id = Guid.NewGuid();
     _db.AccountBook.Add(data);
 }