public void Create(Rol rol) { try { var r = crudRol.Retrieve <Rol>(rol); if (r != null) { throw new BussinessException(3); } crudRol.Create(rol); } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }
public void Create(Rol rol) { try { var c = crudRol.Retrieve <Rol>(rol); if (c != null) { throw new BussinessException(15); } crudRol.Create(rol); var mng = new Vista_RolManager(); foreach (string vista in rol.Vistas) { var vistaRol = new Vista_Rol { IdVista = vista, IdRol = rol.Codigo }; mng.Create(vistaRol); } var mngRolHotel = new RolHotelManager(); foreach (string hotel in rol.Hoteles) { var rolHotel = new RolHotel { IdRol = rol.Codigo, IdHotel = hotel }; mngRolHotel.Create(rolHotel); } } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }
public void Create(Rol rol) { crud.Create(rol); }