Esempio n. 1
0
        public ActionResult Create(BookingsViewModels model)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    AccountBook acct = new AccountBook()
                    {
                        Id         = Guid.NewGuid(),
                        Categoryyy = Convert.ToInt32(model.BookType),
                        Amounttt   = model.BookAmount,
                        Dateee     = model.BookDate,
                        Remarkkk   = model.BookMemo
                    };

                    AccountBookService.AddData(acct);
                    AccountBookService.Save();
                    return(RedirectToAction("Index"));
                }

                return(View(model));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Index(AccountViewModel pageData)
        {
            //Thread.Sleep(3000);

            if (ModelState.IsValid)
            {
                AccountBook objAccountBook = new AccountBook
                {
                    Id         = Guid.NewGuid(),
                    Categoryyy = (int)(pageData.Type),
                    Amounttt   = pageData.AmountMoney,
                    Dateee     = pageData.AccountDate,
                    Remarkkk   = pageData.remark
                };

                var AddService = AccountBookService.AddData(objAccountBook);
            }

            return(View("Index"));
            // return RedirectToAction("ListAccountData");
        }