public void Update(ModuleDto model)
 {
     if (!string.IsNullOrEmpty(model.LinkUrl) && model.LinkUrl.Split('/').Length == 3)
     {
         string[] link = model.LinkUrl.Split('/');
         model.Area = link[0];
         model.Controller = link[1];
         model.Action = link[2];
     }
     var entity = _moduleRepository.GetById(model.Id);
     _moduleRepository.Update(model.MapTo(entity));
 }
Exemplo n.º 2
0
 public void Create(ModuleDto model)
 {
     if (!string.IsNullOrEmpty(model.LinkUrl) && model.LinkUrl.Split('/').Length == 3)
     {
         string[] link = model.LinkUrl.Split('/');
         model.Area       = link[0];
         model.Controller = link[1];
         model.Action     = link[2];
     }
     model.Enabled = false;
     _moduleRepository.Insert(model.MapTo <Module>());
 }
 public void Create(ModuleDto model)
 {
     if (!string.IsNullOrEmpty(model.LinkUrl) && model.LinkUrl.Split('/').Length == 3)
     {
         string[] link = model.LinkUrl.Split('/');
         model.Area = link[0];
         model.Controller = link[1];
         model.Action = link[2];
     }
     model.Enabled = false;
     _moduleRepository.Insert(model.MapTo<Module>());
 }
Exemplo n.º 4
0
        public void Update(ModuleDto model)
        {
            if (!string.IsNullOrEmpty(model.LinkUrl) && model.LinkUrl.Split('/').Length == 3)
            {
                string[] link = model.LinkUrl.Split('/');
                model.Area       = link[0];
                model.Controller = link[1];
                model.Action     = link[2];
            }
            var entity = _moduleRepository.GetById(model.Id);

            _moduleRepository.Update(model.MapTo(entity));
        }