public VMRol RegistrarRol(string nombre, string descripcion, int idPais, int idRol = 0) { try { IDAORol iDaoRol = new DAORol(); VMRol Rol = new VMRol(); RespuestaBD resp = iDaoRol.RegistrarEditarRol(idRol, descripcion, nombre, idPais, true); if (resp.EXISTE_ERROR) { throw new Exception(resp.MENSAJE); } else { Rol.Descripcion = descripcion; Rol.Nombre = nombre; Rol.IdPais = idPais; Rol.IdRol = Convert.ToInt32(resp.dataSet.Tables[0].Rows[0]["fi_id_Rol"].ToString()); Rol.Pais = resp.dataSet.Tables[0].Rows[0]["fc_pais"].ToString(); return(Rol); } } catch (Exception ex) { throw new Exception(new Util().ObtenerMsjExcepcion(ex)); } }