Exemplo n.º 1
0
        public void Create(EmailProviderViewModel emailProviderVM)
        {
            var EmailProvider = new EmailProvider
            {
                EmailProviderName = emailProviderVM.EmailProviderName
            };

            unitOfWork.EmailProviderRepository.Insert(EmailProvider);
            unitOfWork.Save();
        }
Exemplo n.º 2
0
        public void Update(EmailProviderViewModel emailProviderVM)
        {
            var EmailProvider = new EmailProvider
            {
                EmailProviderId   = emailProviderVM.EmailProviderId,
                EmailProviderName = emailProviderVM.EmailProviderName
            };

            unitOfWork.EmailProviderRepository.Update(EmailProvider);
            unitOfWork.Save();
        }
        // GET: EmailProvider/Details/5
        public ActionResult Details(int id = 0)
        {
            if (id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            EmailProviderViewModel details = emailProviderService.GetById(id);

            if (details == null)
            {
                return(HttpNotFound());
            }
            return(View(details));
        }
        public ActionResult Edit(EmailProviderViewModel emailProviderVM)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    // TODO: Add update logic here

                    emailProviderService.Update(emailProviderVM);
                    return(RedirectToAction("Index"));
                }
                catch
                {
                    return(View());
                }
            }
            return(View());
        }
        public ActionResult Create(EmailProviderViewModel emailProviderVM)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    emailProviderService.Create(emailProviderVM);
                }


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }