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(); }
public void AddAccountBook(AccountBook entity) { SkillTreeHomeworkEntities1 _dbcontext = new SkillTreeHomeworkEntities1(); _dbcontext.AccountBook.Add(entity); _dbcontext.SaveChanges(); }
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")); }