Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            EmailList emaillist = EmailListRepository.GetSingle(id);

            if (emaillist == null)
            {
                return(HttpNotFound());
            }
            try
            {
                EmailListRepository.Delete(emaillist);
                EmailListRepository.Save();

                if (IsSuperAdmin)
                {
                    return(RedirectToAction("Index", new { storeId = emaillist.StoreId }));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Unable to delete:" + emaillist, ex);
                ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
            }

            return(View(emaillist));
        }
Пример #2
0
        //
        // GET: /EmailLists/Edit/5

        public ActionResult SaveOrEdit(int id = 0)
        {
            EmailList emaillist = new EmailList();

            if (id != 0)
            {
                emaillist             = EmailListRepository.GetSingle(id);
                emaillist.UpdatedDate = DateTime.Now;
            }
            else
            {
                emaillist.UpdatedDate = DateTime.Now;
                emaillist.CreatedDate = DateTime.Now;
                emaillist.State       = true;
            }
            return(View(emaillist));
        }
Пример #3
0
        //
        // GET: /EmailLists/Delete/5

        public ActionResult Delete(int id)
        {
            EmailList emaillist = EmailListRepository.GetSingle(id);

            return(View(emaillist));
        }
Пример #4
0
        //
        // GET: /EmailLists/Details/5

        public ViewResult Details(int id)
        {
            EmailList emaillist = EmailListRepository.GetSingle(id);

            return(View(emaillist));
        }