Пример #1
0
        public static BankAccountHistoryClaAccess GetModelView(BankAccountHistory bankAccountHistory)
        {
            if (bankAccountHistory == null)
                return null;

            var bankAccountHistoryClaAccess = new BankAccountHistoryClaAccess(bankAccountHistory);
            return bankAccountHistoryClaAccess;
        }
        public ActionResult ClaAccessEdit(BankAccountHistoryClaAccess bankAccountHistoryClaAccess)
        {
            BankAccountHistory newBankAccountHistory = BankAccountHistoryCache.GetDetail(Db, bankAccountHistoryClaAccess.BankAccountHistoryId);
            if (!IsAccess(newBankAccountHistory))
            {
                return RedirectToAccessDenied();
            }

            if (ModelState.IsValid)
            {
                newBankAccountHistory.Ss = bankAccountHistoryClaAccess.Ss;
                newBankAccountHistory.Vs = bankAccountHistoryClaAccess.Vs;
                newBankAccountHistory.Ammount = bankAccountHistoryClaAccess.AmmountView;
                newBankAccountHistory.Note = bankAccountHistoryClaAccess.Note;

                Db.SaveChanges();

                return RedirectToAction("ClaAccessIndex");
            }

            BankAccountHistoryClaAccess newBankAccountHistoryClaAccess = BankAccountHistoryClaAccess.GetModelView(newBankAccountHistory);

            return View(newBankAccountHistoryClaAccess);
        }