Пример #1
0
        public ActionResult Create(CreateViewModel model, int id = 0)
        {
            Account account     = GetAccount();
            Account userAccount = accountDAL.FetchByID(id);

            if (ModelState.IsValid)
            {
                Note _note = new Note
                {
                    accountID   = userAccount.accountID,
                    leftBy      = account.accountID,
                    note        = model.note,
                    dateCreated = DateTime.Now
                };
                noteDAL.Create(_note);
                _email.SendProfileDeclinedEmail(userAccount.email, userAccount.email, model.note);
                return(RedirectToAction("AdminDashboard", "Admin"));
            }
            return(View(model));
        }