예제 #1
0
        public void Create(Guid Id, int Category, DateTime Date, int Amount, String Remark)
        {
            AccountBook Data = new AccountBook
            {
                Id         = Id,
                Categoryyy = Category,
                Dateee     = Date,
                Amounttt   = Amount,
                Remarkkk   = Remark
            };

            db.AccountBook.Add(Data);
            db.SaveChanges();
        }
예제 #2
0
        public void AddAccountBook(AccountBook entity)
        {
            SkillTreeHomeworkEntities1 _dbcontext = new SkillTreeHomeworkEntities1();

            _dbcontext.AccountBook.Add(entity);
            _dbcontext.SaveChanges();
        }
예제 #3
0
 public ActionResult Index([Bind(Include = "Category, Money, Date, Description")] MoneyList moneyList)
 {
     if (ModelState.IsValid)
     {
         var skillTreeHomeworkEntities = new SkillTreeHomeworkEntities1();
         skillTreeHomeworkEntities.AccountBooks.Add(new AccountBook()
         {
             Id         = Guid.NewGuid(),
             Categoryyy = int.Parse(moneyList.Category),
             Amounttt   = (int)moneyList.Money,
             Dateee     = moneyList.Date,
             Remarkkk   = moneyList.Description
         });
         skillTreeHomeworkEntities.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }