Beispiel #1
0
        public override bool Add(object dto)
        {
            bool isCan = false;

            try {
                isCan = dao.Add(dto);
            }
            catch (Exception ex)
            {
                Log((dto as UserDTO).Page, "Error", ex.ToString());
            }
            return(isCan);
        }
Beispiel #2
0
        public ActionResult IncluirMenu(MenuModelView model)
        {
            if (model == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (!ModelState.IsValid)
            {
                ViewBag.Role = new SelectList(roleDAO.List(), "Id", "Description", model.Role);
                return(View(model));
            }
            var menu = MenuFactory.BuildModel(model);

            menu.Role = roleDAO.GetById(model.Role);

            menuDAO.Add(menu);
            return(RedirectToAction("IndexMenus"));
        }