Esempio n. 1
0
        public ActionResult Create(AddDomainModel model)
        {
            var response = _domainService.AddDomain(model);

            if (response.Success)
            {
                return(RedirectToAction("Index", "Domain", new { notificationSuccess = response.Message }));
            }
            return(RedirectToAction("Index", "Domain", new { notificationError = response.Message }));
        }
Esempio n. 2
0
        //[ExceptionAspect]
        public DataResponse AddDomain(AddDomainModel model)
        {
            var domain = _mapper.Map <Domain>(model);

            if (_domainDal.SetState(domain, EntityState.Added))
            {
                return new DataResponse
                       {
                           Message = "Domain Added !!!",
                           Success = true
                       }
            }
            ;
            return(new DataResponse
            {
                Message = "Failed to Add :( :( :(",
                Success = false
            });
        }